I had the same problem today,
Problem: onPageFinished is always called. If there is an error, it will be called after onErrorReceived.
This is the solution I found:
holder.image.setWebViewClient(new WebViewClient() { private boolean error; @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); error = false; } @Override public void onReceivedError( WebView view, int errorCode, String description, String failingUrl) { error = true; System.out.println("description error" + description); view.setVisibility( View.GONE ); } @Override public void onPageFinished(WebView view, String url) { if (!error) { view.setVisibility( View.VISIBLE ); } error = false; } });
sourcerebels
source share