I saw this topic that tells me how to display HTML text in a TextView in Java. For example, if my TextView has "<small>Hello</small>" as its text and I used the code in that topic, I would see a small "Hello" in my TextView.
Now I want to reverse this. I want to get the HTML code of the TextView that I have enabled HTML format, i.e., I want to get "<small>Hello!</small>". Is there a way to do this?
I have tried tv.getText()
(tv is the name of the TextView), but it instead returned "Hello", not as I had expected.