首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

TextView里字段怎么获取超链接

2012-08-26 
TextView里字段如何获取超链接strings.xml文件内容如下:resourcesstring nameautolink_textThis is

TextView里字段如何获取超链接
strings.xml文件内容如下:
<resources>
    <string name="autolink_text">
    This is autolink text example.
    If you click on link http://www.google.com, then it will launch web browser. 
    If you click on wzyang@gmail.com, then it will launch email program.
    And, if you click on phone number (626)888-6666,
    it should dial the phone automatically.</string>
</resources>
在main.xml文件内容如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
    android:id="@+id/text"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:autoLink="all"  
         android:textSize="25sp"
    android:text="@string/autolink_text"/>
</LinearLayout>
显示结果如图:

热点排行