title: ProgressBar in android fragment
body: <p>I have a <code>progressbar</code> in a <code>webview</code> inside a <code>fragment</code>. Inside the <code>onViewCreated()</code> method I have: </p>
  
  <pre><code>ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress_bar);
  </code></pre>
  
  <p>The <code>progressbar</code> is defined as follows:</p>
  
  <pre><code>&lt;ProgressBar
          android:id="@+id/progress_bar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          style="?android:attr/progressBarStyleHorizontal"
          /&gt;
  </code></pre>
  
  <p>And to show the progress of loading the page I have the following code: </p>
  
  <pre><code>webView.setWebChromeClient(new WebChromeClient() {
              @Override
              public void onProgressChanged(WebView view, int progress) {
                  progressBar.setProgress(progress);
              }
          });
  </code></pre>
  
  <p>And I am loading the url: <code>"http://www.techcrunch.com"</code></p>
  
  <p>The problem is, while the page is loading the <code>progressbar</code> isn't visible. So to debug this I tried to output the progress inside the <code>onProgressChanged()</code> method. Where am I going wrong?</p>
  
  <p>I have used <a href="https://stackoverflow.com/questions/27720958/progressbar-in-fragment-layout">this</a> link and <a href="https://stackoverflow.com/questions/2537454/android-webview-progress-bar">this</a> link as a reference but no joy.</p>