2

I want to display some HTML content in a TextView. The content is dynamically parsed using JSON parsing. Given below is extracted from the JSON response I got, when I tried the link in browser.

<p><font color='#FF0000'><strong>MESSAGE BLOCKED.</strong></font><br />nThank you.</p>

But when I finished parsing in phone,the html tags looked like:

"& lt;","p &gt" etc

I have no idea why this is happening. Please Help. Thanks in advance

user2586981
  • 100
  • 1
  • 6

1 Answers1

1

res is the String(From Server)

 Spanned sp = Html.fromHtml(res.replace("&lt;", "<").replace("&gt;", ">"));
 textview.setText(sp);
luttu android
  • 1,443
  • 16
  • 22