text += "百度超链接";
CharSequence charSequence = Html.fromHtml(text);
textview.setText(charSequence);
textview.setMovementMethod(LinkMovementMethod.getInstance());
<TextView
android:id="@+id/textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="all" />
textview = (TextView) findViewById(R.id.textview);
String str = "我的号码:13926190296\n";
str += "百度的网址:http://www.baidu.com";
textview.setText(str);
textview.setMovementMethod(LinkMovementMethod.getInstance());
textview = (TextView) findViewById(R.id.textview);
String text = "百度连接\n";
SpannableString str = new SpannableString(text);
Object obj = new URLSpan("http://www.baidu.com");
str.setSpan(obj, 0, 4, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
textview.setText(str);
textview.setMovementMethod(LinkMovementMethod.getInstance());
String text = "百度链接";
SpannableString str = new SpannableString(text);
Resources resources = getResources();
Bitmap bitmap = BitmapFactory.decodeResource(resources, R.drawable.ic_launcher);
Object obj0 = new ImageSpan(MainActivity.this,bitmap);
Object obj1 = new URLSpan("http://www.baidu.com");
str.setSpan(obj0, 0, 4, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
str.setSpan(obj1, 0, 4, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
textview.setText(str);
textview.setMovementMethod(LinkMovementMethod.getInstance());
textview.setMovementMethod(LinkMovementMethod.getInstance());