I want to use HTML in my TextView (sub- and superscript). The problem is, that I only want to use XML when coding my UI elements: I don’t want to use HTML.fromHtml(...);.
The string I have in my resources is the following code:
...
<string name="buttonY1"><![CDATA[<html><i>Y</i><sup>2</sup></html>]]></string>
...
The XML code is:
...
<TextView android:text="@string/buttonY1"
android:textSize="20sp"
android:gravity="center_horizontal"></TextView>
...
When I debug my app, the text shows plain text (with the tags still in it), and not the parsed HTML. Any solutions?
Simple remove the CDATA part, just include the tags as they are e.g.: