As far as I can understand your question, you want to show the progress bar
if the page is loading in the webview
and when page is fully loaded then display the content of the page. Right ?
Here is what you can do.
getWindow().requestFeature(Window.FEATURE_PROGRESS);
webview.getSettings().setJavaScriptEnabled(true);
final Activity activity = this;
webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different scales.
// The progress meter will automatically disappear when we reach 100%
// Here you can check if the progress is = 100 or not
if(progress == 100){
// hide the progress bar
// show the webview
} else {
// show the progress bar
// hide the webview
}
}
});
webview.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
}
});
webview.loadUrl("http://developer.android.com/");
Code reference from Webviews - Android developers