Home > Web Front-end > HTML Tutorial > 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
Release: 2016-06-24 11:41:49
Original
1605 people have browsed it

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.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template