title: Android layout design - How to get the screen height in xml(layouts)
body: <p>I have to design the screen.I want to put the footer bar below the list.
  See here:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout android:id="@+id/main"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_height="fill_parent"
  android:layout_width="fill_parent"
  android:background="@drawable/wallpaper"&gt;
  
  &lt;!-- Header --&gt;
  &lt;LinearLayout android:id="@+id/header"
      android:background="#0099CC"
      android:layout_height="wrap_content"
      android:layout_width="fill_parent"&gt;
  
      &lt;TextView android:id="@+id/routeCode"
          android:layout_height="fill_parent"
          android:layout_width="wrap_content"
          android:text="Code"
          android:width="100dip"
          android:height="30dip"
          android:textColor="@color/black"
          android:gravity="center_horizontal"
      /&gt;
      &lt;TextView android:id="@+id/routeName"
          android:layout_height="fill_parent"
          android:layout_width="wrap_content"
          android:text="Name"
          android:width="150dip"
          android:height="30dip"
          android:textColor="@color/black"
          android:gravity="center_horizontal"
      /&gt;
      &lt;TextView android:id="@+id/outlets"
          android:layout_height="fill_parent"
          android:layout_width="wrap_content"
          android:text="Outlets"
          android:width="60dip"
          android:height="30dip"
          android:textColor="@color/black"
          android:gravity="center_horizontal"
      /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;!-- List Divider --&gt;
  &lt;View android:layout_width="fill_parent"
      android:layout_height="1dip"
      android:background="?android:attr/listDivider" /&gt;
  
      &lt;!-- ListView (grid_items) --&gt;
      &lt;LinearLayout android:id="@+id/layout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" 
                                          android:layout_weight="1" &gt;
  
          &lt;ListView android:id="@android:id/list"
                    android:layout_height="405dp"
                    android:layout_width="fill_parent"&gt;
          &lt;/ListView&gt;
  
          &lt;TextView android:id="@id/android:empty"
                    android:layout_width="fill_parent" 
                    android:gravity="center_vertical"
                    android:layout_height="fill_parent" 
                    android:layout_marginTop="25dp" 
                    android:text="No Sales Routes Define By Admin" /&gt;
      &lt;/LinearLayout&gt;
  
       &lt;!-- Footer --&gt;
      &lt;RelativeLayout android:id="@+id/header"
          android:background="#000000"
          android:layout_height="wrap_content"
          android:layout_width="fill_parent"&gt;
  
          &lt;Button android:text="Exit" 
                  android:id="@+id/button1" 
                  android:background="#0099FF"
                  android:layout_width="wrap_content" 
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="8dp"
                  android:onClick="onExitAction"&gt;
          &lt;/Button&gt;
  
          &lt;Button android:layout_width="wrap_content" 
                  android:text="Next" 
                  android:background="#0099FF"
                  android:layout_height="wrap_content" 
                  android:layout_marginRight="8dp"
                  android:id="@+id/button2" 
                  android:layout_alignParentTop="true" 
                  android:layout_alignParentRight="true"
                  android:onClick="onNextAction"&gt;
         &lt;/Button&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Problem is if there no data for list or few rows are avilable, then footerbar will come up.How to fix that thing.I want to fixed in below part.I won't to come up....</p>
  
  <p>When I add this code <code>android:layout_weight="1"</code> it coming like this :
   <img src="https://i.stack.imgur.com/9H0Hx.png" alt="enter image description here"></p>
  
  <p>This is my Tab xml part;</p>
  
  <pre><code>     &lt;?xml version="1.0" encoding="utf-8"?&gt;
  
     &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:id="@android:id/tabhost"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:fadingEdge="horizontal"&gt;
  
      &lt;RelativeLayout
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
           &gt;
  
          &lt;FrameLayout
              android:id="@android:id/tabcontent"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:textColor="#ffffff" /&gt;
  
          &lt;TabWidget
              android:id="@android:id/tabs"
              android:layout_width="fill_parent"
              android:layout_height="56dp"
              android:gravity="bottom"
              android:tabStripEnabled="true"
              android:layout_alignParentBottom="true"/&gt;
  
      &lt;/RelativeLayout&gt;
     &lt;/TabHost&gt;
  </code></pre>
  
  <p>I want that bar above the tab..</p>
  
  <p>Please help me..</p>
  
  <p>thanks in advance</p>