title: Android Layout Priority?
body: <p>I studied Android XML but I got a problem about layouts.
  As you can see, I declared 2 linear layouts and 1 relative layout, so the order is Linear (1) - Relative (2) - Linear (3)
  However when I run this, the display shows Linear (1) - Linear (3) - Relative (2).</p>
  
  <p>So, I wonder if there is a priority or rules in Layouts :)</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffff0000"
      &gt;
      &lt;Button
          android:id="@+id/backBtn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:text="Linear_Layout1 (1)" 
          /&gt;
  
      &lt;RelativeLayout 
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#ff000000"
          &gt;   
          &lt;TextView
              android:id="@+id/text01"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerInParent="true"
              android:text="Relative_layout1 (2)"
              android:textColor="#ff0000ff"
              android:textSize="19dp" 
              /&gt;
          &lt;TextView
              android:id="@+id/text02"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Mosquito"
              android:textColor="#ff00ff00"
              android:textSize="15dp"
              android:background="#ffff0000"
              android:layout_centerInParent="true"
              android:layout_toRightOf="@id/text01"
              /&gt;
          &lt;LinearLayout 
              android:layout_height="wrap_content"
              android:layout_width="match_parent"
              android:orientation="vertical"
              android:background="#fff0f0f0"
              &gt;
              &lt;TextView
                  android:id="@+id/text03"
                  android:gravity="center"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="Linear_layout2 (3)"
                  /&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>