Android app: Html formatting “[]” when importing text from database Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Android app: Html formatting “[]” when importing text from database without wasting too much if your time.

The question is published on by Tutorial Guruji team.

When I in my android application import text from my database it returns text with a square symbol. The text in the database is pasted from a webpage so I belive it is som html formatting, [ENTER] etc.
Is it possible to make the textview understand the formatting and use it as it is intended to look in a webbrowser. I am not interested in changing the view if it can be avoided, just to make the textstring use the formatting to make nl etc.

Any one know how it can be done.

enter image description here

Answer

Before setting the text in the TextView you can use the Html.fromHtml method on the text, this will format the text appropriately.

We are here to answer your question about Android app: Html formatting “[]” when importing text from database - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji