hi
In a list view i have an webview which should load a image file from the server,when there is no image present i need a dummy image .I tried
holder.imag
I had the same issue today,
The problem: onPageFinished is called always. If there is an error it will be called after onErrorReceived.
This is the solution I've 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;
}
});