title: Error in android layout according to layout arrange dependencies
body: <p>When I change the arrange of layouts, and change dependency accordingly, i get an exception.</p>
  
  <p>I have the following layout (causes the error):</p>
  
  <h3>Layout XML</h3>
  
  <pre><code>    &lt;LinearLayout
        android:id="@+id/followerssLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tagsLayout"&gt;
        &lt;ImageView
            android:id="@+id/imgFollowers"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitXY"
            android:src="@drawable/ic_users"
            android:contentDescription="@drawable/ic_users" /&gt;
        &lt;TextView
            android:id="@+id/lblSelectedFollowers"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            style="@style/LabelData"
            android:paddingLeft="5dp"
            android:paddingRight="5dp"
            android:layout_weight=".75"
            android:hint="@+string/select_followers" /&gt;
        &lt;ImageButton
            android:id="@+id/imgbAddUsers"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitXY"
            android:src="@drawable/ic_add_user"
            android:contentDescription="@drawable/ic_add_user"
            android:visibility="gone" /&gt;
    &lt;/LinearLayout&gt;
    &lt;LinearLayout
        android:id="@+id/buttonsLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/followerssLayout"
        android:paddingBottom="15sp"&gt;
        &lt;Button
            android:id="@+id/btnDeleteTask"
            style="@style/Widget.Button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:text="@string/delete"
            android:layout_weight=".5"
            android:layout_marginLeft="5sp"
            android:layout_marginStart="5sp"
            android:layout_marginRight="5sp"
            android:layout_marginEnd="5sp" /&gt;
        &lt;Button
            android:id="@+id/btnSaveTask"
            style="@style/Widget.Button"
            android:layout_width="0dp" 
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:text="@string/save"
            android:layout_weight=".5"
            android:layout_marginLeft="5sp"
            android:layout_marginStart="5sp"
            android:layout_marginRight="5sp"
            android:layout_marginEnd="5sp" /&gt;
    &lt;/LinearLayout&gt;
    &lt;LinearLayout
        android:id="@+id/subTasksLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/buttonsLayout"
        android:paddingBottom="15sp"&gt;
        &lt;ImageView
            android:id="@+id/imgSubTasks"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitXY"
            android:src="@drawable/ic_sub_tasks"
            android:contentDescription="@drawable/ic_sub_tasks" /&gt;
        &lt;ListView
            android:id="@+id/lstSubTasks"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight=".55"&gt;
        &lt;/ListView&gt;
        &lt;TextView
            android:id="@+id/lblEmpty"
            android:hint="@string/add_subtask"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:layout_gravity="center_vertical"
            android:visibility="gone"
            style="@style/LabelData"&gt;
        &lt;/TextView&gt;
    &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This causes the following exception:</p>
  
  <h3>Exception</h3>
  
  <pre><code>05-18 18:29:35.897: E/AndroidRuntime(1508): FATAL EXCEPTION: main
  05-18 18:29:35.897: E/AndroidRuntime(1508): java.lang.ClassCastException:
      android.widget.Button cannot be cast to android.widget.ListView
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at com.horizons.engiz.ui.FragManageTask.onCreateView(FragManageTask.java:142)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.Fragment.performCreateView(Fragment.java:1504)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:942)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1484)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:450)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.os.Handler.handleCallback(Handler.java:615)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.os.Handler.dispatchMessage(Handler.java:92)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.os.Looper.loop(Looper.java:137)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at java.lang.reflect.Method.invokeNative(Native Method)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at java.lang.reflect.Method.invoke(Method.java:511)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  05-18 18:29:35.897: E/AndroidRuntime(1508):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Important info: when i put <code>buttons Layout</code> below <code>sub Tasks Layout</code> and change <code>layout_below</code> accordingly , it works fine</p>
  
  <p>any help will be most appreciated</p>