Skip to content Skip to sidebar Skip to footer

How Can I Save Text From An Edittext Without Loosing The Features Of The Text Like Bold, Italic Etc. In Android

All I am trying to do is to get the text from the Edittext which is having the features like bold and italic and saving it in a text file but when I read it back and display it, th

Solution 1:

You can use Html.toHtml() to convert the Editable that you get back from getText() on an EditText to an HTML representation. Then, later on, you can use Html.fromHtml() to convert the HTML back into something that can be used in an EditText. toHtml() and fromHtml() do not handle every possible span used by EditText, but it should handle the basics like bold and italics.


Post a Comment for "How Can I Save Text From An Edittext Without Loosing The Features Of The Text Like Bold, Italic Etc. In Android"