I use Linkify to detect tags (#) in a TextView.
Pattern userMatcher = Pattern.compile("\\B@[^:\\s]+");
String userViewURL = "https://www.instagram.com/explore/tags/";
Linkify.addLinks(tvComment, userMatcher, userViewURL);
The URL is supposed to contain text without the '#' character.
I want to use it to search Instagram:
https://www.instagram.com/explore/tags/mytag
but Linkify opens the url with the character '#':
https://www.instagram.com/explore/tags/#mytag
How to remove the "#" character from a link created using Linkify.
source
share