Currently, I have a String like
http://www.example.com/defg-/\nletters
I put this String into a TextView, and make the url clickable by setAutoLinkMask(Linkify.WEB_URLS) and setMovementMethod(LinkMovementMethod.getInstance())
However, the link is recognize wrongly, where only
http://www.example.com/defg <--missing "-/"
is highlighted but not
http://www.example.com/defg-/ <--I want this
, and results in a wrong url.
What should I do such that the url can be recognized correctly?
The Sample Result (2nd link is wrongly recognized)
Code Implementation
txtNorm = (TextView) findViewById(R.id.txtNorm);
txtNorm.setText("http://www.example.com/defg-/");
txtNorm.setAutoLinkMask(Linkify.WEB_URLS);
txtNorm.setMovementMethod(LinkMovementMethod.getInstance());
txtCustom = (TextView) findViewById(R.id.txtCustom);
txtCustom.setText("http://www.example.com/defg-/\nletters");
txtCustom.setAutoLinkMask(Linkify.WEB_URLS);
txtCustom.setMovementMethod(LinkMovementMethod.getInstance());