I have a textview that I need to link. That's what I'm doing.
TextView text = (TextView) view.findViewById(R.id.name); text.setText("Android...Update from Android"); Pattern pattern = Pattern.compile("Android"); String scheme = "www.android.com"; Linkify.addLinks(text, pattern, scheme);
The text view displays correctly with the text "Android ... Update from Android", but I have two problems.
1) My text string contains two instances of the string "Android". Thus, both texts are related. I want only the first occurrence to be connected. How can I do it?
2) When I click the linkfy link, it opens a browser, but the URL is weird. The URL he is trying to open is www.comandroid. I do not know what is going on here. The text “android” in the URL is replaced. I am doing something wrong when linknifying text.
Any help would be greatly appreciated.
source share