Android textView控件自动识别电话号码,网址,邮箱,点击自动跳转到相应的功能
在开发的时候我们需要实现这些功能非常简单,只需要在textView控件里面加上一句话:
<TextView
android:id="@+id/textView2"
style="@style/B5_Font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/color_hei"
android:autoLink="email|phone|web"
android:maxWidth="250dp"
android:textSize="16.0sp" />
如下就是这行代码即可:
android:autoLink="email|phone|web"