开发者

Android TextView respond to html <a> clicks

开发者 https://www.devze.com 2023-01-10 22:15 出处:网络
I have formatted data with commands embedded withtags. I use the HTML class to populate the TextView. Is there a way to intercept the click on the link and get what was clicked?

I have formatted data with commands embedded with tags. I use the HTML class to populate the TextView. Is there a way to intercept the click on the link and get what was clicked?

Html.fromHtml("<a href='CM开发者_JAVA技巧D:Bahai'>Some Command Link</a>");


I found that the WikiNotes example project from Google does exactly that. It uses the Linkify infrastructure with a Provider and MIMIE type to load the right Activity.

0

精彩评论

暂无评论...
验证码 换一张
取 消