I have getting dynamic text from a web service and showing the same in a TextView. Sometimes the TextView has url like <a href="http://hello.com">hello</a>
. I have set the text using the following code.
textView.setText(Html.fromHtml(sampletext));
And also set android:autoLink="web"
in the corresponding xml of that contains the TextView
. Now the link is showing properly with blue color and underline, but I found the its just a dead link. Nothing is happening if we try to click it. What I have to do to make the link active?
To Save any one time the true solution is
and i use it and it work perfect
i have give some idea which i have found it
string.xml
main.xml
In your XML, you need to add
android:linksClickable="true"
in the TextView.