Following my previous question I still have problems managing hyperlinks on my custom AlertDialog
but I believe I narrowed down the problem because I think it o
Try this
setText(Html.fromHtml(String));
You defined the TextView without android:autoLink="all"
, android:clickable="true"
& android:linksClickable="false"
For info.xml TextView as below
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/infoDetailText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp" />
Anyway, your code works perfectly,...
Code for AlertDialog:
LayoutInflater inflater = LayoutInflater.from(ctx);
View layout = inflater.inflate(R.layout.info, null);
AlertDialog.Builder about = new AlertDialog.Builder(ctx);
about.setTitle("Data");
about.setIcon(R.drawable.info);
// Make the textview clickable. Must be called after show()
TextView textView = (TextView) layout.findViewById(R.id.infoDetailText);
textView.setText(R.string.link_text_manual);
textView.setMovementMethod(LinkMovementMethod.getInstance());
about.setView(layout);
AlertDialog displayInfo = about.create();
displayInfo.show();
Code of TextView XML:
<TextView
android:id="@+id/infoDetailText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/infoVersionTitle"
android:padding="4dp" />
Removed two attributes..
android:autoLink="all"
android:linksClickable="true"