title: android.widget.ProgressBar cannot be cast to android.widget.LinearLayout
body: <p><strong>GIVEN</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".InboxActivity" &gt;
  
      &lt;!-- refresh button --&gt;
  
      &lt;Button
          android:id="@+id/button_refresh_inbox"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:onClick="refreshInbox"
          android:text="@string/refresh_inbox" /&gt;
  
      &lt;LinearLayout
          android:id="@+id/inbox_container"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@id/button_refresh_inbox" &gt;
  
          &lt;ProgressBar
              android:id="@+id/inbox_prog_bar"
              style="@android:style/Widget.ProgressBar.Small"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:id="@+id/empty_inbox"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@id/inbox_container"
          android:textIsSelectable="false" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>RESULT</strong>:</p>
  
  <p>When I run the app I get the error</p>
  
  <pre><code>E/AndroidRuntime(930): java.lang.ClassCastException: android.widget.ProgressBar
  cannot be cast to android.widget.LinearLayout
  </code></pre>
  
  <p>Does anyone know how to fix this?</p>
  
  <p><strong>OBJECTIVE</strong>:</p>
  
  <p>Get a progress bar to show while the inbox is loading; then have the inbox content fill the linear layout.</p>
  
  <p><strong>BACKGROUND</strong>:</p>
  
  <p>Everything has been working fine. I just thought it better to have a progress bar instead of a blank screen while the inbox is loading. Adding the progress bar caused the error. (I really want to specify the progress bar in the layout file, not programmatically).</p>