Skip to content

Instantly share code, notes, and snippets.

@yahyaahrika
Forked from thinzaroo/webViewLoading
Created August 31, 2016 22:02
Show Gist options
  • Save yahyaahrika/d04a993673897084d6d3ec0292d59e6d to your computer and use it in GitHub Desktop.
Save yahyaahrika/d04a993673897084d6d3ec0292d59e6d to your computer and use it in GitHub Desktop.
Android WebView Progressbar
WebView webView = (WebView)findViewById(R.id.webview);
String url = "";
ProgressDialog dialog = new ProgressDialog(this);
webView.setWebChromeClient(new WebChromeClient(){
@Override
public void onProgressChanged(WebView view, int newProgress) {
dialog.setMessage("Loading");
dialog.show();
if(newProgress == 100 && dialog.isShowing())
dialog.dismiss();
}
});
webView.loadUrl(url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment