的WebView发布新的更新Android操作系统

问题描述 投票:1回答:1

最近一些设备停止工作的WebView组件,我检测机器人8和Android 6或fewers所有工作分辩,但在设备与Android 7点9没有文字显示。这个问题在最新的周开始。我自2018年2月没有更新的应用

descripcion = (WebView) findViewById(R.id.txt_descripcion);

String description="<html><body><head><style type=\"text/css\">\n" +
            "p {\n" +
            "font-size:90%;text-indent: 1em; text-align:justify; \n" +
            "}\n" +"body {font-family: Arial, Helvetica, sans-serif;}\n" +
            "\n" +
            "table {     font-family: \"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;\n" +
            "    font-size: 12px;     width: 100%; text-align: left;    border-collapse: collapse; }\n" +
            "\n" +
            "th {     font-size: 13px;     font-weight: normal;          background: #b9c9fe;\n" +
            "    border-top: 4px solid #aabcfe;    border-bottom: 1px solid #fff; color: #039; }\n" +
            "\n" +
            "td {         background: #e8edff;     border-bottom: 1px solid #fff;\n" +
            "    color: #669;    border-top: 1px solid transparent; }\n" +
            "\n" +
            "tr:hover td { background: #d0dafd; color: #339; }"+
            "</style></head><p>"+hechizo.getDescripcion()+"</p></body></html>";

descripcion.loadData(description,"text/html; charset=UTF-8",null);
java android android-webview
1个回答
2
投票

尝试这个:

WebSettings settings = myWebView.getSettings();
settings.setDefaultTextEncodingName("utf-8");
myWebView.loadDataWithBaseURL(null, htmlString, "text/html", "utf-8", null);
© www.soinside.com 2019 - 2024. All rights reserved.