android超鏈接

tv01 = (TextView)findViewById(R.id.tv01);
tv01.setTextColor(Color.RED);
tv01.setTextSize(22f);
 
//html字符:超鏈接
String htmlhref = "<a href=\"http:www.google.com.h快\">百度</a>";
//Html.fromHtml解析HTML,生成String
tv01.setText(Html.fromHtml(htmlhref));
//html字符:只顯示超練級,不使用
//tv01.setAutoLinkMask(Linkify.All);
//出來顯示還可以點擊
tv01.setMovementMethod(LinkMovementMethod.getInstance()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章