title: Show activity circle before loading webview - Android
body: <p>I am using <code>webview</code> to show a webpage in my app. The webpage takes about 2-3 seconds to load.
  Till the webpage loads, I want to show an activity circle progress bar like the one shown <a href="https://developer.android.com/design/building-blocks/progress.html" rel="nofollow noreferrer">here</a>.<br> This is what an activity circle looks like :</p>
  
  <p><img src="https://i.imgur.com/MXFIdSe.png?1"></p>
  
  <p>How can I accomplish it? </p>
  
  <p>I searched the web but couldn't find a satisfactory and proper explanation of how it is implemented. Thanks!</p>
  
  <p>WebViewPage.java</p>
  
  <pre><code>public class Webpage extends Activity {
  
  WebView web;
  ProgressBar progressBar;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.web_page);
  
      Intent startwebpage = getIntent();
  
      web = (WebView) findViewById(R.id.webView);
      web.setWebViewClient(new myWebClient());
  
      web.getSettings().setJavaScriptEnabled(true);
      web.loadUrl("http://www.google.com");
  }
  
  public class myWebClient extends WebViewClient
  {
      @Override
      public void onPageStarted(WebView view, String url, Bitmap favicon) {
          // TODO Auto-generated method stub
          super.onPageStarted(view, url, favicon);
      }
  
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          // TODO Auto-generated method stub
  
          view.loadUrl(url);
          return true;
  
      }
  
      @Override
      public void onPageFinished(WebView view, String url) {
          // TODO Auto-generated method stub
          super.onPageFinished(view, url);
      }
  }
  }
  </code></pre>