How do I make links in a TextView clickable?
Posted
by Richard
on Stack Overflow
See other posts from Stack Overflow
or by Richard
Published on 2010-04-29T01:41:54Z
Indexed on
2010/04/29
1:47 UTC
Read the original article
Hit count: 303
android
I have the following TextView defined:
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/txtCredits"
android:autoLink="web" android:id="@+id/infoTxtCredits"
android:layout_centerInParent="true"
android:linksClickable="true"></TextView>
where @string/txtCredits is a string resource that contains Link text.
Android is highlighting the links in the TextView, but they do not respond to clicks. Can someone tell me what I'm doing wrong? Do I have to set an onClickListener for the TextView in my activity for something as simple as this?
© Stack Overflow or respective owner