Link in android TextView

I have a text view with the text “This is a product developed by XYZ. For additional requests, write to us at info@abc.com. And I linked“ info@abc.com ”. But the problem is, I touch any area below the text fields, it is connected with email.How can I make sure that the connection should only happen when the info @ button is clicked .... I used templates, Linkify.EMAIL_ADDRESS..Nothing seems to work..kindly offer some answers

+5
source share
4 answers

I had problems with automatic links, so I turned it off, and instead I use html text generation plus this code:

TextView textView = (TextView) findViewById(R.id.TextBox);
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(Html.fromHtml(strText));

Email link is coming <a href="mailto:my@email.com">my@email.com</a>

+17
source

the best way i used and it always worked for me

 android:autoLink="web"

Hope this helps all of you.

Thanks Rohit

+17
source

HTML, .. .

0

Linkify :

myTextView.setAutoLinkMask(Linkify.EMAIL_ADDRESSES);
myTextView.setLinksClickable(true);
0

All Articles