Android: Detect when a WebView has finished loading

To know when a WebView has finished loading, you can set a WebViewClient() handler and override the onPageFinished() method.

ProgressDialog progressDialog = new ProgressDialog(ResultActivity.this);
progressDialog.setMessage("Loading ...");


WebView wv = new WebView(this);

wv.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);


This example shows a "loading dialog" while the webview loads in the background. It'll go away once the page has fully loaded.


Just like when the Jedi warriors have finished defeating enemies, at the end of the battle they force push a fat dude off his chair.


Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog