java WebView在完成加载侦听器时加载DataWithBaseURL
我正在使用loadDataWithBaseURL从字符串加载webview中的数据。我想实现一个侦听器,它告诉我数据何时被完全加载,以便我可以继续我的代码
我搜索了很多,但找不到任何相关的主题
if (new String(rowData.getResource().getData()) != null) webView.loadDataWithBaseURL("", new String(rowData.getResource().getData()), "text/html", "UTF-8", "about:blank");
# 1 楼答案
使用WebViewClient并实现onPageStarted、onPageFinished以了解webview的状态
# 2 楼答案
试试这个经过测试的工作演示