简体   繁体   中英

WebView load HTML but doesn't display

I have fragments with webview in pager and i have custom htmls to set that webviews. When i paging, some webviews -not every times, sometimes- doesn't show html. When i inspected webviews from chrome://inspect/ and look the elements webview has, i can see the html but i see blank page in ui. And i'm absolutely sure there is no problem in html. It is very strange.

I set it like this;

webViewDetail.getSettings().setDefaultTextEncodingName("utf-8");
webViewDetail.getSettings().setUserAgentString(Locale.getDefault().getLanguage());
    webViewDetail.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    webViewDetail.getSettings().setDomStorageEnabled(true);
    webViewDetail.getSettings().setJavaScriptEnabled(true);
    webViewDetail.getSettings().setBuiltInZoomControls(true);
    webViewDetail.getSettings().setSupportZoom(true);
    webViewDetail.getSettings().setDisplayZoomControls(false);
    webViewDetail.loadDataWithBaseURL("", contentHtml, "text/html", "utf-8", "");

onReceivedError doesn't called because there is no problem as i said. Even onPageFinished called. But onPageCommitVisible doesn't called also.

您确定Web视图的布局正确吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM