title: Android linear layouts aligning to bottom of screen
body: <p>Been tearing my hair out all day over this </p>
  
  <p>I am trying to have two linear layouts at the bottom of the screen, each will have a few bottoms. I want one linear layout to the right and one to the left </p>
  
  <p>So far I have </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout
      android:id="@+id/home_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
      &lt;!-- MAIN CONTENT WILL GO HERE --&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:id="@+id/ad_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/home_layout"
      android:layout_alignParentBottom="true"
      android:gravity="bottom" &gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="right"
          android:background="@android:color/white"
          android:gravity="right"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="£12.50" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Rate1 **** " /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>which produces </p>
  
  <p><img src="https://i.stack.imgur.com/fnro0.png" alt="first attempt">
  Now I try and add the second layout on the left hand side </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout
      android:id="@+id/home_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
      &lt;!-- MAIN CONTENT WILL GO HERE --&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:id="@+id/ad_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/home_layout"
      android:layout_alignParentBottom="true"
      android:gravity="bottom" &gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="left"
          android:background="@android:color/white"
          android:gravity="left"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="£12.50" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Rate1 **** " /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="right"
          android:background="@android:color/white"
          android:gravity="right"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="£12.50" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Rate1 **** " /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>which produces:</p>
  
  <p><img src="https://i.stack.imgur.com/iqRE5.png" alt="enter image description here"></p>
  
  <p>Any idea?</p>