Or far simpler than dealing with Spannable
s manually, since you didn’t say that you want the background highlighted, just the text:
String styledText = "This is <font color="red">simple</font>.";
textView.setText(Html.fromHtml(styledText), TextView.BufferType.SPANNABLE);
Related Contents:
- Android TextView Justify Text
- Set color of TextView span in Android
- Is it possible to have multiple styles inside a TextView?
- How to set the part of the text view is clickable
- How to change the font on the TextView?
- How can I use TypefaceSpan or StyleSpan with a custom Typeface?
- android ellipsize multiline textview
- Is there a way to make ellipsize=”marquee” always scroll?
- how to make a specific text on TextView BOLD
- Put constant text inside EditText which should be non-editable – Android
- Android read text raw resource file
- How do I center text horizontally and vertically in a TextView?
- Android Paint: .measureText() vs .getTextBounds()
- Is it possible to display inline images from html in an Android TextView?
- Android: TextView: Remove spacing and padding on top and bottom
- How to set TextView textStyle such as bold, italic
- Android – Set text to TextView
- How to set emoji by unicode in a textview?
- How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView
- How to set a particular font for a button text in android?
- How to scale/resize text to fit a TextView?
- Disable orange outline highlight on focus
- Calculate text size according to width of text area
- Add “View More” at the end of TextView after 3 lines [duplicate]
- Android textview outline text
- How to handle RTL languages on pre 4.2 versions of Android?
- Android: Where is the Spinner widget’s text color attribute hiding?
- Android intercept paste\copy\cut on editText
- Android character by character display text animation
- Disabling Android O auto-fill service for an application
- Add custom font for complete android application
- Android TextView : “Do not concatenate text displayed with setText”
- auto-scrolling TextView in android to bring text into view
- What is meant by Ems? (Android TextView)
- How to make the text direction from right to left
- Set font for all textViews in activity?
- Change clickable TextView’s color on focus and click?
- How to wrap lengthy text in a spinner? [duplicate]
- Set Text to Integer Value
- How to add bulleted list to android application?
- How to Measure TextView Height Based on Device Width and Font Size?
- android change text color of items in spinner
- How to bring view in front of everything?
- To draw an Underline below the TextView in Android
- Get current visible text in textview
- Right align text in android TextView
- Rounded corner for textview in android
- Android ClickableSpan not calling onClick
- Android text view color doesn’t change when disabled
- Mobile Web – Disable long-touch/taphold text selection