How to show a progress bar for a layout until the WebView is loaded

admin

Administrator
Staff member
I am loading a WebView to the LinearLayout and want to display a ProgressBar inside this layout until the WebView is fully loaded.I wnet through the below links and they seems to be really great but I do not want to use <strong>ProgressDialog</strong>, instead I would like to use progressbar inside the layout.

<a href="http://xjaphx.wordpress.com/2011/07/31/load-webview-with-progressdialog/" rel="nofollow noreferrer">http://xjaphx.wordpress.com/2011/07/31/load-webview-with-progressdialog/</a>

<a href="https://stackoverflow.com/questions/3903895/how-to-show-progress-bar-on-webview">how to show progress bar on webview?</a>

How would I do that?

Say for example,

Code:
if(pos==0)
{
 mLayout.setVisibility(View.VISIBLE);
 mWeb.loadUrl("http://android.stackexchange.com/");
}

Inside
Code:
mLayout
I would like to display a progressbar until the page gets displayed.