text: Q:
  
  how to show the Progress Bar till the WebView content is appears in android
  
  i am trying to give Progress Bar till the content of the WebView is loaded. 
  in xml 
              <ProgressBar android:id="@+id/progressbar"
                  style="?android:attr/progressBarStyleHorizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="5dp"
                  android:max="100"
                  android:visibility="gone" />
  
              <WebView
                  android:id="@+id/intro2"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"/>
  
  in java 
      ProgressBar pbr= (ProgressBar)findViewById(R.id.progressbar);
      pbr.setProgress(0);
      pbr.setVisibility(View.VISIBLE);
  
      WebView view = (WebView) findViewById(R.id.mgs1);
      String text = "<html><head><style type=\"text/css\">table, th, td { table-layout: fixed; padding: 2px;  text-align: center; background-color: #339933; border: 2px solid white; border-collapse: collapse; }\"></style></head> <body style=\"text-align:justify; color:#ffffff; margin-right :30px; background-color:#339933;\"> %s </body></Html>";
      String data = "<table style=width: 30%; > <tr><td>17</td> <td>24</td> <td>1</td> <td>8</td> <td>15</td></tr>  </table>";
      view.loadData(String.format(text, data), "text/html", "utf-8");
      view.getSettings().setDefaultFontSize(12);
  
  After this what should i do?
  
  A:
  
  Use setWebViewClient for webview as follows for your purpose. Read the comments for where t start and stop the progress bar. 
  view.setWebViewClient(new WebViewClient() {
          @Override
          public void onPageStarted(WebView view, String url, Bitmap favicon) {
              super.onPageStarted(view, url, favicon);
              // Show progressbar
              pbr.setVisibility(View.VISIBLE);
          }
  
          @Override
          public void onReceivedError( WebView view, int errorCode, String description, String failingUrl) {
              // Show error 
              // Stop spinner or progressbar
              pbr.setVisibility(View.GONE);
  
          }
  
          @Override
          public void onPageFinished(WebView view, String url) {
              super.onPageFinished(view, url);
              // Stop spinner or progressBar
              pbr.setVisibility(View.GONE);
  
          }
      });
  
  