How to get value as htmltext in textview in android?

Possible duplicate:
How to display HTML in TextView?

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

Tell us how to handle these tags in a text view.

Thanks in advance.

+4
source share
1 answer
 textView.setText(Html.fromHtml("<p>" + title + "</p>"); 

you can also browse the user's web pages

 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

+5
source

Source: https://habr.com/ru/post/1299538/


All Articles