I need to render some text with simple markup <b> <i> etc. and it looks like this should do the trick for displaying it, but I’m wondering if it’s possible to store the string *with the markup in the Strings.xml or if I have to just keep this string in my Java file.
I need to render some text with simple markup <b> <i> etc. and it
Share
See this link: Formatting and Styling, particularly the “Styling with HTML markup” subsection.
After getting the text via
Html.FromHtml(), set the text to aTextViewusing thesetText(CharSequence text, TextView.BufferType type)method, passing inTextView.BufferType.SPANNABLEfor the 2nd parameter.