How do I know if there were no errors in loading a page in webview
? Here is the code for the onReceivedError
:
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
view.stopLoading(); // may not be needed
switch (Locale.getDefault().toString()) {
case "es_ES":
view.loadUrl("file:///android_asset/www/errorPage.forRestActivities.es_ES.HTML");
break;
default:
view.loadUrl("file:///android_asset/www/errorPage.forRestActivities.en_US.HTML");
break;
}
}
});
I would use onPageFinished() for that.