I am trying to load webviews in a view pager.
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanc
I had a fix on this
just set webChromeClient and catch the error and reload the page...
myWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
isLoading = true;
}
@Override
public void onPageFinished(WebView view, String url) {
myWebView.loadUrl("javascript:testFunction()");
}
});
myWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
MessageLevel level = consoleMessage.messageLevel();
if(level.ordinal() == 3) { // Error ordinal
if(loading) {
myWebView.stopLoading();
myWebView.loadUrl(AppConstants.ARTICLE_PAGE_URL);
}
}
}
return false;
}