How to listen for a WebView finishing loading a URL?

前端 未结 17 729
予麋鹿
予麋鹿 2020-11-22 05:40

I have a WebView that is loading a page from the Internet. I want to show a ProgressBar until the loading is complete.

How do I listen for

17条回答
  •  囚心锁ツ
    2020-11-22 06:30

    Extend WebViewClient and call onPageFinished() as follows:

    mWebView.setWebViewClient(new WebViewClient() {
    
       public void onPageFinished(WebView view, String url) {
            // do your stuff here
        }
    });
    

提交回复
热议问题