本例主要研究一下如何在TextView中显示网页链接和改变特定文字颜色
1.main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HelloWorld,HomeActivity!"/>
</LinearLayout>
2.MainActivity.java:
package com.yayun.edittex