Skip to content

Instantly share code, notes, and snippets.

@mahdimortazavi
Created December 20, 2016 15:51
Show Gist options
  • Save mahdimortazavi/0a8249c5470ff9eae7b4908c3e0ab833 to your computer and use it in GitHub Desktop.
Save mahdimortazavi/0a8249c5470ff9eae7b4908c3e0ab833 to your computer and use it in GitHub Desktop.
webView setProgress
WebView webView =(WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://www.google.com");
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
setTitle("Loading...");
setProgress(progress * 100);
if(progress == 100)
setTitle(R.string.app_name);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment