Android WebViewClient onLoadResource () is called agian after onPageFinished () when targetSdkVersion is 19

I defined a CustomWebViewClient class that extends WebViewClient, and simply overrides onLoadResource () and onPageFinished () to control progressbar visibility as follows:

@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); } 

This all works well when targetSdkVersion in AndroidManifest.xml is 17. But after I set it to android: targetSdkVersion = "19", the progressbar will be displayed forever, and I find that onLoadResource () is called again after onPageFinished () called.

What is wrong here?

+5
source share

Source: https://habr.com/ru/post/1205418/


All Articles