In an Android app I am using a TabView and one of the tabs shows a WebView. But the page is blank until the web page loads. How would one show a progress bar until the page
I use a ProgressBar for this. With a layout like this:
I hide and show the progress indicator using:
WebView webView = (WebView) findViewById(R.id.WebView);
final ProgressBar progess = (ProgressBar) findViewById(R.id.ProgressBar);
webView.setWebViewClient(new WebViewClient() {
public void onPageStarted(WebView view, String url, Bitmap favicon) {
progess.setVisibility(View.VISIBLE);
}
public void onPageFinished(WebView view, String url) {
progess.setVisibility(View.GONE);
}
}