show progress dialog on webview
<p>In my android application i am opening a webview.I want to hide url that is getting loaded,so the default window progress bar doesnot work for me.</p>

<p>Is there any way than that i can add progress dialogue on webview.</p>

<p>I am using the below code.</p>

<pre><code> mWebView = (WebView) findViewById(R.id.webview);
     mWebView.getSettings().setJavaScriptEnabled(true); 

     final Activity activity = this; 

     mWebView.setWebChromeClient(new WebChromeClient(){ 

     public void onProgressChanged(WebView view, int progress) { 
     activity.setTitle("Loading..."); 
     activity.setProgress(progress * 100); 
     if(progress == 100) 
     activity.setTitle("My title"); 
     } 
     }); 

     mWebView.loadUrl(Url);
     mWebView.setWebViewClient(new HelloWebViewClient());
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
</code></pre>

<p>}</p>

<pre><code>private class HelloWebViewClient extends WebViewClient {   
    ProgressDialog MyDialog=new ProgressDialog(context);

    public boolean shouldOverrideUrlLoading(WebView view, String url) {    
        MyDialog.show();  
        view.loadUrl(url);  
        return true;  
         }
</code></pre>

<p>Please share your valuable suggestions.</p>

<p>Thanks in advance :)</p>
