代码如下:
/*TextView显示网页*/textView1 = (TextView) this.findViewById(R.id.textview1);
textView2 = (TextView) this.findViewById(R.id.textview2);
// 添加一段html的标志
String html = "font color='red'I love android/fontbr";
html += "font color='#0000ff'bigiI love android/i/big/fontp";
html += "biga href='http://www.jb51.net'脚本之家/a/big";
CharSequence charSequence = Html.fromHtml(html);
textView1.setText(charSequence);
textView1.setMovementMethod(LinkMovementMethod.getInstance());// 点击的时候产生超链接
String text = "我的URL:http://www.jb51.netn";
text += "我的email:****** @gmail.comn";
text += "我的电话:+ 86 137********";
textView2.setText(text);
textView2.setMovementMethod(LinkMovementMethod.getInstance());