5

I've defined a CustomWebViewClient class that extends WebViewClient, and simply override onLoadResource() and onPageFinished() to control progressbar's visibility as follow:

@Override
public void onPageFinished(WebView view, String url) {
    super.onPageFinished(view, url);
    this.progressBar.setVisibility(View.INVISIBLE);
}

@Override
public void onLoadResource(WebView view, String url) {
    super.onLoadResource(view, url);
    this.progressBar.setVisibility(View.VISIBLE);
}

These all work well when the targetSdkVersion in AndroidManifest.xml is 17. But after I set it to android:targetSdkVersion="19", progressbar keeps visible forever, and I find that onLoadResource() is called again after onPageFinished() is called.

What's going wrong here?

Tiago Barreto
  • 822
  • 13
  • 31
tuoniuniu
  • 93
  • 6

0 Answers0