1

I have a TextView, in which I am putting some HTML content using Html.fromHtml(). The TextView has an onClick() method, which is used to perform several actions. Sometimes the HTML that is in the TextView contains links, which are recognised as links, but are unclickable. I can make them clickable, but then that stops the onClick method.

My question is, is there a way that, if the user clicks on a link then the link opens, but if the user doesnt click on a link then the onClick() method for the TextView is called, rather than it being either one or the other for every click.

Thanks

leedsunited92
  • 582
  • 5
  • 12
  • Possible duplicate: http://stackoverflow.com/questions/4251745/android-clickable-textview-with-linkified-links – Tony the Pony Apr 18 '12 at 21:01
  • 1
    Does look like a similar problem but that solution doesn't work for me – leedsunited92 Apr 21 '12 at 12:47
  • its too late to answer this but if some one needs more clear answer its at [StackOverFlow](http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable) – PravinDodia Sep 12 '12 at 16:37

1 Answers1

1

You may use Linkify to do it in code:

Linkify.addLinks(yourTextView, Linkify.ALL);
waqaslam
  • 67,549
  • 16
  • 165
  • 178