title: How do I add a rotating spinner to my webview?
body: <p>I have made a webview in which I require to add a loading /rotating spinner. I have the image for the same, but I am not sure how do I go about it such that when the webview loads it starts rotating and when the entire view is loaded it stops. Here is my code so far:</p>
  
  <pre><code> @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_search_answers, container, false);
        mWebview =  (WebView)view.findViewById(R.id.webview);
  
  
          mWebview.setVisibility(View.VISIBLE);
  
  
              mWebview.setWebViewClient(new MyWebViewClient(this, mWebview));
              mWebview.getSettings().setPluginState(PluginState.ON);
              mWebview.getSettings().setUseWideViewPort(true);
              mWebview.getSettings().setDefaultZoom(ZoomDensity.FAR);
              mWebview.getSettings().setBuiltInZoomControls(true);
              mWebview.getSettings().setSupportZoom(true);
              mWebview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
              mWebview.getSettings().setAllowFileAccess(true);
              mWebview.getSettings().setDomStorageEnabled(true);
              mWebview.getSettings().setJavaScriptEnabled(true);
              mWebview.setHttpAuthUsernamePassword(HOST, REALM, USERNAME, PASSWORD);
              mWebview.getSettings().setAppCacheEnabled(true);
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB)
                  mWebview.getSettings().setDisplayZoomControls(false);
  
              mWebview.loadUrl(URL);
  
  
          return view;
      }
  </code></pre>
  
  <p>P.S:I would like to add constant animated rotation. Here is the code for rotate.xml I added under animations:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;rotate
          android:fromDegrees="180.0"
          android:toDegrees="0.0"
          android:pivotX="50%"
          android:pivotY="50%"
          android:duration="200"
      /&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>Any idea how I can connect my webview to the imae and ultimately to rotate.xml so it meets the expected criteria?</p>
  
  <p>Thanks!
  Justin</p>