I\'m trying to load in my WebView some HTML code that contains JavaScript.
Now , I want to test if my WebView is loaded before 5 secondes. I\'ve tried the method
The below code works perfectly. Once the page has been loaded successfully it will trigger onPageFinished()
webView.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Toast.makeText(getApplicationContext(),"Started",Toast.LENGTH_SHORT).show();
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
Toast.makeText(getApplicationContext(),"Loaded",Toast.LENGTH_SHORT).show();
super.onPageFinished(view, url);
}
});