Home  >  Article  >  Web Front-end  >  The table in html is displayed on the android side_html/css_WEB-ITnose

The table in html is displayed on the android side_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:41:491574browse

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

to xml android:id="@ id/wv1"

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn