TextView显示链接

TextView的内容如果包含一个URL,将autoLink属性设置为web,该控件将找到并突出显示该URL

 <TextView 
  	android:layout_width="fill_parent"
  	android:layout_height="wrap_content"
  	android:text="这是百度的网址:http://www.baidu.com/"
  	android:autoLink="web"/>

 也可以通过Linkify类实现

	TextView mTextView = (TextView)findViewById(R.id.mTextView);
		Linkify.addLinks(mTextView, Linkify.WEB_URLS);
 

你可能感兴趣的:(Web,android,百度)