Janusz Janusz - 3 months ago 10
Android Question

How to listen for a WebView finishing loading a URL?

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 the completion of page loading of a
WebView
?

ian ian
Answer

Just implement WebViewClient and extend onPageFinished() as follows:

mWebView.setWebViewClient(new WebViewClient() {

   public void onPageFinished(WebView view, String url) {
        // do your stuff here
    }
});
Comments