Created
December 20, 2016 16:20
-
-
Save mahdimortazavi/f6d9e0ea10922bd524a5c7040378b53d to your computer and use it in GitHub Desktop.
ProgressDialog webView
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
final ProgressDialog pd = ProgressDialog.show(this, "", "Loading...", true); | |
WebView webView = (WebView) findViewById(R.id.webview); | |
webView.getSettings().setJavaScriptEnabled(true); | |
webView.loadUrl("https://www.google.com"); | |
webView.setWebViewClient(new WebViewClient() { | |
@Override | |
public void onPageFinished(WebView view, String url) { | |
if (pd != null && pd.isShowing()) { | |
pd.dismiss(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment