TextView changevideoqualitytxt = (TextView) Rootview.findviewbyid (r.id.enter_wireless_display_txt);
String Text1 = getString (R.string.enter_application_wireless_display);
Spannablestringbuilder style1 = new Spannablestringbuilder (Text1);
Style1.setspan (New Foregroundcolorspan (Getresources () GetColor (R.color.high_light_color)), Spannable.span_ exclusive_inclusive);
Changevideoqualitytxt.settext (Style1);
If you want to insert a picture in a line of text:
TextView changevideoqualitytxt = (TextView) Rootview.findviewbyid (r.id.choose_txt);
String Text1 = getString (R.string.connect_display);
Spannablestringbuilder style1 = new Spannablestringbuilder (Text1);
Style1.setspan (New Imagespan (this, r.drawable.focus_txt_background), and spannable.span_exclusive_inclusive);
Changevideoqualitytxt.settext (Style1);
Android: Change the color of a few words in a line of text with code