机器人:HTML中的TextView与链接点击 [英] android: html in textview with link clickable

查看:128
本文介绍了机器人:HTML中的TextView与链接点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用A-htmltag我的TextView ,但是当我点击它没有任何反应。

I use an a-htmltag in my TextView, but when i tap on it nothing happens.

我怎样才能使其与网址打开网页浏览器?

How can I make it open the web browser with the url?

推荐答案

试试这个

txtTest.setText( Html.fromHtml("<a href=\"http://www.google.com\">Google</a>"));
txtTest. setMovementMethod(LinkMovementMethod.getInstance());

这篇关于机器人:HTML中的TextView与链接点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆