Friday, 21 August 2015

How to display HTML in TextView?

You need to use Html.fromHtml() to use HTML in your XML Strings. Simply referencing a String with HTML in your layout XML will not work.

For example:
myTextView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));





No comments:

Post a Comment