<TextView
android:id="@+id/link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Forget password?"
android:autoLink="all"
android:linksClickable="true"
android:textColor="@color/lgreen"
android:textStyle="italic"
/>
Android is highlighting the links in the TextView, but they do not respond to clicks. Can someone tell me how can i do that as a clickable and move to another link. i tried more times by seeing examples. but i can't. Can some one explain me clearly how to change text view as a clickable link.
You can add click listener to TextView and start websearch:
and xml looks like:
this is the EDITED answer
Hi you can try by replacing this in you layout.xml file
I have tried it and it will surely work. and treats "www.google.com" as web link
In the string file put this code
and in the XML file
In your
onCreate()
method put this code:I tried a number of solutions. But this worked perfectly for me.
Just add onClick tag to your TextView which equals the defined function. Just as below
Here is simple implementation tested up to Android N