我从我的ressource strings.xml中取一个字符串,然后将该字符串放在TextView中。
在strings.xml中:
<string name="description">Hello please look into <a href="http://www.webtour.dk">www.webtour.dk</a></string>
在main.xml中:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/description"
android:textSize="12dp"
android:textStyle="bold" />
我得到了这个结果很好的结果,www.webtour.dk显示为一个链接。但是当我点击链接时我什么都没有!没有导航器推出??
答案 0 :(得分:2)
只需使用Linkify自动查找网站:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/description"
android:textSize="12dp"
android:textStyle="bold" />
然后从你的文字中取出html:
<string name="description">Hello please look into www.webtour.dk</string>