Showing a progressBar in a popup
<p>I have a popup dialog box in which I am loading a webview. I want to show a progressBar while the webview is loading on top of the popup window.
I have found a way to show loading progressbar while the webpage loads but if this webview is loading in the popup dialog box the progressBar is not shown on top of it.
Can someone explain the reason why this is happening.</p>

<p>Here is the code</p>

<p>[code]</p>

<pre><code> @SuppressWarnings("static-access")
    public void showPopUp(String url){
            try{

                Dialog dialog = new Dialog(Links.this);
                LayoutInflater inflater = (LayoutInflater)getSystemService(Links.this.LAYOUT_INFLATER_SERVICE);
                View vi = inflater.inflate(R.layout.link_popup, null);
                dialog.setContentView(vi);
                dialog.setTitle("Title here");
                dialog.setCancelable(true);
                WebView wb = (WebView) vi.findViewById(R.id.WebView01);

                wb.setWebViewClient(new MyWebViewClient());
                wb.getSettings().setJavaScriptEnabled(true);   
                wb.getSettings().setSupportZoom(true);      
                wb.loadUrl(url);
//              final Activity MyActivity = this;  
//              
//              progressDialog = ProgressDialog.show(dialog.getOwnerActivity(), "", "Loading....", true);
//              
//              wb.setWebChromeClient(new WebChromeClient() {
//               public void onProgressChanged(WebView view, int progress)   
//               {
//                   MyActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded
//                   if(progress == 100){
//                    if(progressDialog.isShowing())
//                           progressDialog.dismiss();
//                   }
//                 }
//               }); 

                System.out.println("..loading url..");  
                dialog.show();

             }catch(Exception e){
                 System.out.println("Exception while showing Agreement : " + e.getMessage());
             }
        } 
</code></pre>

<p>[/code]</p>

<p>It was not working so I commented it.</p>

<pre><code>link_popup.xml
</code></pre>

<p>[code]</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="fill"
android:id="@+id/layout_root"
android:background="#000000"
&gt;

        &lt;ProgressBar

            android:layout_width="fill_parent" 
            android:layout_height="5dip"
            android:layout_alignParentTop="true" 
            style="?android:attr/progressBarStyleHorizontal"
            android:id="@+id/progressbar_Horizontal"
            android:max="100"
            android:background="#228b22"
         /&gt;
        &lt;WebView  
            android:id="@+id/WebView01"
            android:layout_below="@id/progressbar_Horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_centerVertical="true"
            android:layout_centerInParent="true"
            android:scrollbars="@null"
          /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>[/code]</p>
