title: What's wrong with my include in RelativeLayout?
body: <p>I want to create an activity with a title bar at top and a navigation bar at bottom. I used <code>include</code> to include the title bar layout and the navigation bar layout into the main layout as you can see below. The result is that both the title bar and navigation bar go to the top of the screen. Could someone tell me why? Thanks!</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/home_widget" android:layout_width="fill_parent"
      android:layout_height="fill_parent" 
      android:background="@drawable/background"&gt;
  
      &lt;include android:id="@+id/title_bar" layout="@layout/title_bar" 
          android:layout_alignParentTop="true" /&gt;
  
      &lt;include android:id="@+id/navigation_bar" layout="@layout/navigation_bar" 
          android:layout_alignParentBottom="true"/&gt; 
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>[Edit]
  I didn't find the root cause. But the following works:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/home_widget" 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:background="@drawable/background"&gt;
  
  &lt;RelativeLayout android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true"
      android:id="@+id/title_bar" &gt;
  
      &lt;include layout="@layout/title_bar" /&gt;
  &lt;/RelativeLayout&gt;
  
  &lt;RelativeLayout android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true"
      android:id="@+id/navigation_bar" &gt;
  
      &lt;include layout="@layout/navigation_bar" /&gt;
   &lt;/RelativeLayout&gt;
  </code></pre>