My problem is that I can’t open two identically defined links in the same layout, just the first one. If I long-click the first one, a context menu appears saying “Copy URL”, but for the second one, it doesn’t. The links are valid ones.
Here are the two textviews defined:
<TextView
android:id="@+id/txt_id1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center_horizontal"
android:linksClickable="true"
android:text="@string/text1"
android:textColor="@color/white"
android:textColorHighlight="@color/white"
android:textSize="18sp" />
<TextView
android:id="@+id/txt_id2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center_horizontal"
android:linksClickable="true"
android:text="@string/text2"
android:textColor="@color/white"
android:textColorHighlight="@color/white"
android:textSize="18sp" />
I’m running a custom rom with Android 2.3.7 (CyanogenMod) on a Motorola Defy (Jordan). I tried it on the emulator, but it doesn’t work either.
Any answers are well appreciated.
EDIT:
<string name="text1"><a href="http://www.google.com">http://www.google.com</a></string>
<string name="text2"><a href="http://www.wikipedia.org">Text2</a></string>
Guess what. If I do something like this:
<string name="text1"><a href="http://www.google.com">Text1</a></string>it is underlined, highlighted, etc. as a link, but it doesn’t redirect me to the desired page.
Instead, if I insert in the textview this string
android:text="http://www.google.com"it is also underlined and highlighted as a link, but this time it redirects me to the desired page.This means I don’t need any
<a>s.