Skip to content

Instantly share code, notes, and snippets.

@dmpatel151282
Created December 22, 2016 06:46
Show Gist options
  • Save dmpatel151282/3b64de9b901d34b90cbe302e57119585 to your computer and use it in GitHub Desktop.
Save dmpatel151282/3b64de9b901d34b90cbe302e57119585 to your computer and use it in GitHub Desktop.
String htmlString =
"<h1>HTML String Title in TextView</h1>\n" +
"<h3>HTML Paragraph:</h3>\n" +
"<p>Display html string in android TextView. How to show HTMl string in android TextView. This html paragraph</p>\n" +
"<h3>HTML Unordered List: </h3>\n" +
"<ol>\n" +
"\t<li>HTML List Item 1</li> \n" +
"\t<li>HTML List Item 2</li>\n" +
"\t<li>HTML List Item 3</li>\n" +
"\t<li>HTML List Item 4</li>\n" +
"</ol>";
TextView textView = (TextView) findViewById(R.id.display_html_string);
textView.setText(Html.fromHtml(htmlString));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment