I know that if you put a link in a textview it will work but if I want to display for example:
google stackoverflow
and not the whole link(just the tag) How do i make those links clickable?
I know that if you put a link in a textview it will work but if I want to display for example:
google stackoverflow
and not the whole link(just the tag) How do i make those links clickable?
Very simple way to do this---
In your Activity--
Then you will get just the Tag, not the whole link..
Hope it will help you...
I hit on the same problem and finally find the working solution.
in the string.xml file, define:
Replace the "<" less than character with HTML escaped character.
In Java code:
And the TextBox will correctly display the text with clickable anchor link
You could have two separate TextViews and you could align them accordingly in your layout if needed:
Then if you want to strip the "link underline". Create a class:
Then add this method in your main Activity class where you have the TextViews
And then just call this after you initialised the TextViews (in your onCreate):
this should work.
and
The link is, "Android: textview hyperlink"
and the tag is, "google stack overflow"
Define the first code block in your java and the second code block in your strings.xml file. Also, be sure to reference the id of the textView from your page layout in your java.
This is my working implementation
and to change color of hyperlinks , i editted my xml for textview -