title: How to PROPERLY show ProgressBar for a Webview while loading
body: <p>I wan't to indicate that my webview is loading in some way. Using the Progressbar seems like a good solution but I am not certain how to properly do this.
  By Progressbar I mean a spinning thingie in Android.</p>
  
  <p>This is what I know by now and what I have tried:
  I know about onPageStarted(...) and onPageFinished(...) callbacks which you define inside the WebViewClient and then hide or show Progressbar based on calls to those methods. BUT this approach is creating many problems with the HTML page inside the webview. For example when I hide Progressbar HTML elements resize and than go back to their original sizes for a brief moment. This looks really ugly and I don't know why this is happening. I tried putting my Progressbar and webview inside Frame and Relative layout (in order to have the progress cantered) and with both of these I get the above problem. HTML page loading is Javascript heavy since there is <a href="http://cubiq.org/iscroll-4" rel="nofollow">http://cubiq.org/iscroll-4</a> library on it but I doubt it's the problem with the library since the same page loads without strange behaviours when opened in Browser app on the phone.</p>
  
  <p>My main problem is that I don't know how to define a layout containing my Progressbar and webview and avoid strange zoom in/out jumps. That is why I am asking how should one show progress bar correctly over a webview.</p>
  
  <p>EDIT:
  This is one of the layouts I tried:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;WebView
      android:id="@+id/webview"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" /&gt;
  
  &lt;ProgressBar
      android:id="@+id/progressBar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>It's more or less similar with relative layout but I use centerInPerent=true on both axes for the ProgressBar</p>