直接贴代码
textContent = (TextView) findViewById(R.id.content);
String strLoadString="<a href=\"http://www.baidu.com\">点击我</a>";
CharSequence charSequence = Html.fromHtml(strLoadString);
textContent.setText(charSequence);
textContent.setClickable(true);
textContent.setMovementMethod(LinkMovementMethod.getInstance());
xml代码
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:singleLine="false" >
</TextView>
一定不要加 android:autoLink 属性 否则html里面加载的a标签就无效