我的onReceivedError()
不适用于所有Android手机。它仅适用于少数几个。可能是什么原因造成的?
对于我的新onRecievedError()
superWebView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
//here you can do something when received error in WebView
superWebView.loadUrl("file:///android_asset/index.html");
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
});
superWebView.setWebChromeClient(new WebChromeClient(){
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
superProgressBar.setProgress(newProgress);
}
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
getSupportActionBar().setTitle(title);
}
});
我希望该应用程序可以在所有可以安装的Android上运行。 有人遇到过这种错误吗?