简体   繁体   中英

How to intercept click on link in TextView?

I have TextView and it contain HTML with tags. I need to intercept user's clicks on this links, take value of "href" parameter, check it and open my activity if it local link or open browser if it link to another site.

I've try to search and find that , but I can't understand how to use it in my case.

Please, help.

There's this method: https://stackoverflow.com/a/3452944/1799219

All it's really doing is passing the link to your own activity (as links are normally passed to other activities) and then you extract the URL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM