Closed ErfanDP closed 10 months ago
You're right, <<hello.hi>>
shouldn't be accepted as hyperlink. Hyperlink pattern responsible for this is Android's own code Patterns.WEB_URL
. What we can do is change it using our own regex. Something like:
textView.setHyperlinkPattern(Pattern.compile("(?!<a\sname=\"([\w\s\d\-\.\#]+)\"><\/a>)<a\sname=\"([\w\s\d\-\.\#]+)\">(.*?)<\/a>"));
But I haven't tested it. I suppose a lot of test are required in order to replace Patterns.WEB_URL
.
Closed for inactivity.
text view detects something like <> as hyperlink anyway to prevent that from happening?