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"
[b][color=red]android:autoLink="all"[/color][/b]
android:textSize="25sp"
android:text="@string/autolink_text"/>
</LinearLayout>
显示结果如图:
<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"
[b][color=red]android:autoLink="all"[/color][/b]
android:textSize="25sp"
android:text="@string/autolink_text"/>
</LinearLayout>
显示结果如图: