title: How to push included layout to bottom of screen?
body: <p>I have a layout called footer.xml which later will be included to multiple layouts. Footer.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/bottomMenu"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom"
      android:orientation="horizontal"
      android:layout_alignParentBottom="true"
      android:background="@drawable/bg_gradation"
      android:weightSum="1" &gt;
  *** STUFF GOES HERE ***
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Footer.xml will then be included in other layout as follows..</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. --&gt;
  &lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/backrepeat"&gt;
  
      &lt;!-- As the main content view, the view below consumes the entire
           space available using match_parent in both dimensions. --&gt;
      &lt;LinearLayout
         android:id="@+id/content_frame"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
         android:layout_marginBottom="0dp"
         android:weightSum="1"&gt;
          &lt;ListView
              android:id="@+id/chatListView"
              android:layout_width="fill_parent"
              android:layout_height="0dp"
              android:divider="#00000000"
              android:scrollbars="none"
              android:dividerHeight="1dp"
              android:layout_weight=".80"/&gt;
          &lt;LinearLayout
              android:id="@+id/chatBar"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight=".13"
              android:orientation="horizontal"
              android:background="#242424"
              android:weightSum="1"&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
      &lt;include layout="@layout/footer"/&gt;
  
      &lt;!-- android:layout_gravity="start" tells DrawerLayout to treat
           this as a sliding drawer on the left side for left-to-right
           languages and on the right side for right-to-left languages.
           The drawer is given a fixed width in dp and extends the full height of
           the container. A solid background is used for contrast
           with the content view. --&gt;
      &lt;ListView
          android:id="@+id/left_drawer"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="@android:color/transparent"
          android:dividerHeight="0dp"
          android:background="#111"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Since i want footer.xml be at the bottom screen, i use <code>android:layout_gravity="bottom"</code> this renders properly if seen from the perspective of footer.xml</p>
  
  <p>However, when i try to see it from other layouts it throws error that says:</p>
  
  <pre><code>java.lang.UnsupportedOperationException (Error Log does not show helpful information at all).
  </code></pre>
  
  <p><strong>EDIT 1</strong>
  This is the best error message i could get.. (i cannot copy-paste the log text)</p>
  
  <p><img src="https://i.stack.imgur.com/pWoUQ.png" alt="log error"></p>
  
  <p><strong>EDIT 2</strong>
  IF i include my layout this way:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_weight="1"
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;include layout="@layout/footer"
          android:id="@+id/footer"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>It renders the way i want it inside eclipse editor. However, when i try to run it on Android i get the following error:</p>
  
  <pre><code>java.lang.IllegalStateException: Child android.widget.LinearLayout{a72d4938 V.E..... ......ID 0,0-0,0 #7f0a005c app:id/bottomMenu} at index 1 does not have a valid layout_gravity - must be Gravity.LEFT, Gravity.RIGHT or Gravity.NO_GRAVITY
  </code></pre>
  
  <p>and if i editted my footer.xml to this:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/bottomMenu"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &lt;---- not android:layout_gravity="bottom"
      android:background="@drawable/bg_gradation"
      android:weightSum="1" &gt;
  </code></pre>
  
  <p>my footer would fill up the entire screen from top to bottom.</p>
  
  <p>Can anyone help me with this? Thanks..</p>