Check if the webview is loaded

2

I need to check if the webview is loaded to be able to execute a javascript function that is in the webview, but I do not know how to check if the webview is already 100% loaded.

follow the code:

    WebView webView = (WebView)findViewById(R.id.webView);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebViewClient(new webViewClient());
    webView.loadUrl("http://meusite.com");
    
asked by anonymous 22.06.2016 / 02:48

1 answer

3

You can implement onPageFinished () of the WebViewClient class.

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

     } 
});
    
22.06.2016 / 13:02