-
-
Save yahyaahrika/d04a993673897084d6d3ec0292d59e6d to your computer and use it in GitHub Desktop.
Android WebView Progressbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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