Check if webview is loaded

Asked

Viewed 262 times

2

I need to check if the webview is loaded in order to execute a javascript function that is found in the webview, but I don’t know how to check if the webview is already loaded 100%.

follows the code:

    WebView webView = (WebView)findViewById(R.id.webView);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebViewClient(new webViewClient());
    webView.loadUrl("http://meusite.com");

1 answer

3


You can implement the onPageFinished() class Webviewclient.

webView.setWebViewClient(new WebViewClient() { 
     public void onPageFinished(WebView view, String url) { 

     } 
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.