title: Android - Can't hide progress bar
body: <p>So I've checked the other questions to hide a progress bar but all seem to suggest doing what I'm already doing.</p>
  
  <p>I'm trying to use</p>
  
  <pre><code>mProductListProgressBar.setVisibility(View.GONE);
  </code></pre>
  
  <p>and I'm finding it by</p>
  
  <pre><code>mProductListProgressBar = (ProgressBar) mRoot.findViewById(R.id.product_list_progressbar);
  </code></pre>
  
  <p>I know it's the correct progress bar as I can move it around the screen before with various LayoutParams commands. But it won't hide.</p>
  
  <p>The current code I have (including the moving of the progress bar) is</p>
  
  <pre><code>RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
  params.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
  mProductListProgressBar.setLayoutParams(params);
  params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
  mProductListProgressBar.setLayoutParams(params);
  
  mProductListProgressBar.setVisibility(View.GONE);
  mProductListErrorTextView.setVisibility(View.VISIBLE);
  mProductListErrorTextView.setText(errorMessage);
  </code></pre>
  
  <p>The progress bar moves to left and bottom but is still visible. I have tried View.INVISIBLE  as well as View.GONE but neither work.</p>
  
  <p>It's driving me nuts!</p>
  
  <p>Thanks</p>
  
  <p>UPDATE 1</p>
  
  <pre><code>protected void showError(int errorMessage){
  
      /*RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
      params.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
      mProductListProgressBar.setLayoutParams(params);
      params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
      mProductListProgressBar.setLayoutParams(params);
      */
      mProductListProgressBar.setVisibility(View.GONE);
      mProductListErrorTextView.setVisibility(View.VISIBLE);
      mProductListErrorTextView.setText(errorMessage);
  }
  </code></pre>
  
  <p>and calling it with</p>
  
  <pre><code>showError(R.string.wish_list_empty);
  </code></pre>
  
  <p>UPDATE 2</p>
  
  <p>xml of fragment </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;GridView
          android:id="@+id/product_list_gridview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@android:color/transparent"
          android:horizontalSpacing="@dimen/standardMargin"
          android:listSelector="@android:color/transparent"
          android:numColumns="@integer/columns"
          android:scrollbarStyle="outsideOverlay"
          android:verticalSpacing="@dimen/standardMargin" /&gt;
  
      &lt;RelativeLayout
          android:id="@+id/product_list_header"
          android:layout_width="match_parent"
          android:layout_height="@dimen/refineHeaderHeight"
          android:background="@drawable/product_list_header"
          android:visibility="gone" &gt;
  
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:layout_alignParentRight="true"
              android:padding="10dp"
              android:src="@drawable/dropdown_image" /&gt;
  
          &lt;TextView
              android:id="@+id/product_list_header_title"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:gravity="center|left"
              android:paddingLeft="10dp"
              android:textAllCaps="true"
              android:textColor="@android:color/black"
              android:textIsSelectable="false"
              android:textSize="@dimen/standardTextSize" /&gt;
  
          &lt;TextView
              android:id="@+id/product_list_refine_button"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_alignParentBottom="true"
              android:layout_alignParentRight="true"
              android:background="@drawable/button"
              android:clickable="true"
              android:gravity="center_vertical"
              android:paddingLeft="20dp"
              android:paddingRight="30dp"
              android:text="@string/refine"
              android:textAllCaps="true"
              android:textColor="#838383"
              android:textSize="@dimen/standardTextSize" /&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/product_list_footer"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_gravity="center"
          android:background="@drawable/product_list_footer"
          android:gravity="center"
          android:orientation="horizontal"
          android:padding="15dp"
          android:visibility="gone" &gt;
  
          &lt;ProgressBar
              android:layout_width="15dp"
              android:layout_height="15dp"
              android:layout_gravity="center"
              android:layout_marginRight="10dp"
              android:background="@android:color/transparent"
              android:gravity="center" /&gt;
  
          &lt;TextView
              android:id="@+id/product_list_footer_text_view"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:gravity="center"
              android:text="@string/loading_message"
              android:textAllCaps="true"
              android:textSize="@dimen/standardTextSize" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ProgressBar
          android:id="@+id/product_list_progressbar"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"
          android:visibility="gone"/&gt;
  
      &lt;TextView
          android:id="@+id/product_list_error_text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"
          android:textAllCaps="true"
          android:textSize="@dimen/standardTextSize"
          android:visibility="gone" /&gt;
  
      &lt;TextView
          android:id="@+id/debug"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#aa000000"
          android:gravity="left|center_vertical"
          android:minLines="2"
          android:padding="10dp"
          android:textColor="@android:color/white"
          android:visibility="gone" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>