4

Possible Duplicate:
How to display HTML in TextView?

I have a string that contains some tags(<p>,<img>,etc).

Tell how to handle these tags in textview.

Thanks in advance.

Community
  • 1
  • 1
pk.
  • 81
  • 2
  • 4

1 Answers1

5
textView.setText(Html.fromHtml("<p>" + title + "</p>");

you can also user web view

WebView webview = new WebView(this);
 setContentView(webview);

 // Simplest usage: note that an exception will NOT be thrown
 // if there is an error loading this page (see below).
 webview.loadUrl("http://slashdot.org/");

 // Of course you can also load from any string:
 String summary = "<html><body>You scored <b>192 points.</body></html>";
 webview.loadData(summary, "text/html", "utf-8");

http://developer.android.com/reference/android/webkit/WebView.html

zapping
  • 4,118
  • 6
  • 38
  • 56