In the beginning, Html.fromHtml(source); was used to display html
But you will find that it does not parse a series of tags such as style, table, etc.
I had to change my mind and use webview to do it
Add
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
Then in the activity
WebView wView = (WebView)findViewById( R.id.wv1);
wView.getSettings().setDefaultTextEncodingName("UTF -8");
wView.loadData(source, "text/html; charset=UTF-8 ", null);
That's it
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.