请在Android中的超链接的TextView请在、超链接、Android、TextView

由网友(Infatuation 迷恋)分享简介:我想打一个链接,如谷歌一个TextView文本。反正有做这样的链接。 (IE)当上的字点击谷歌应该打开相应链接。任何想法是值得欢迎的。I want to make a link for a textview text like Google. Is there anyway to make link like thi...

我想打一个链接,如谷歌一个TextView文本。反正有做这样的链接。 (IE)当上的字点击谷歌应该打开相应链接。任何想法是值得欢迎的。

I want to make a link for a textview text like Google. Is there anyway to make link like this. (i.e) When clicking on the word Google it should open the appropriate link. Any ideas are welcome.

推荐答案

试试这个,让我知道发生什么事。

Try this, and let me know what happen..

TextView textView =(TextView)findViewById(R.id.textView);
textView.setClickable(true);
textView.setMovementMethod(LinkMovementMethod.getInstance());
String text = "<a href='http://www.google.com'> Google </a>";
textView.setText(Html.fromHtml(text));
阅读全文

相关推荐

最新文章