-2

I set auto link = web but it create unwanted link when TextView text has dot with any character like "i.want" it will create link for it have to prevent this I try to remove dot from string but then guanine link will not generated give some solution for it

code

linktxt.setText(myObj.getpost());

post will get from api .

thank you

Neel
  • 77
  • 7

1 Answers1

0

Try this

TextView textView =(TextView)findViewById(R.id.textView);
textView.setClickable(true);
textView.setMovementMethod(LinkMovementMethod.getInstance());
String text = "This is Neel.desai I want to navigate <a href='http://www.google.com'> Google </a>";
textView.setText(Html.fromHtml(text));

See here for more help Android: textview hyperlink

Community
  • 1
  • 1
Mohammad Tauqir
  • 1,817
  • 1
  • 18
  • 53