从网上转来的,记录一下,稍后有时间再整理。
android textView 加入超链接方式:
1:使用android:autoLink="all" 只需在textview中加入这个属性 在里面写的文字中包含网址、电话、email的会自动加入连接地址。
如: 2:uses a string resource containing explicit <a> tags to specify links.
如: 别忘了
TextView t2 = (TextView) findViewById(R.id.text2);
t2.setMovementMethod(LinkMovementMethod.getInstance());
3: builds the text in the Java code using HTML 4:字符串截取方法
android textView 加入超链接方式:
1:使用android:autoLink="all" 只需在textview中加入这个属性 在里面写的文字中包含网址、电话、email的会自动加入连接地址。
如: 2:uses a string resource containing explicit <a> tags to specify links.
如: 别忘了
TextView t2 = (TextView) findViewById(R.id.text2);
t2.setMovementMethod(LinkMovementMethod.getInstance());
3: builds the text in the Java code using HTML 4:字符串截取方法