在资源中配置
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="blog"><a href="http://www.szhuodong.com/html/2014/jjsz_0826/6510.html">9月6日 盐田创意港饮食文化音乐节开幕</a></string>
<string name="hello_world">活动列表</string>
<string name="app_name">activity_shenzhen</string>
</resources>
然后在布局页面使用这些资源
<TextView
android:id="@+id/mt_blog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="@string/blog"
android:textColor="#F5F5F5"
android:textSize="18sp" />
代码中通过id查找到超链接,进行跳转
TextView t2 = (TextView) findViewById(R.id.mt_blog);
t2.setMovementMethod(LinkMovementMethod.getInstance());
本文虽是原创,但参考了网上资料。如有雷同,请原谅。
最后
以上就是漂亮店员最近收集整理的关于安卓增加超链接最简便处理的全部内容,更多相关安卓增加超链接最简便处理内容请搜索靠谱客的其他文章。
发表评论 取消回复