title: Android two ListViews spacing and layout
body: <p>I have create the following layout, where the UI is consisted of two LinearLayouts, in everyone there is a header textview and a list view. I need to dynamically set the ListView heights so that both display properly.</p>
  
  <p>It is like this right now:</p>
  
  <p><img src="https://i.stack.imgur.com/dbwco.png" alt="Layout"></p>
  
  <p>Look how empty space is wasted below the first ListView while the other one displays scrollbars and can benefit that extra space? </p>
  
  <p>The layout xml looks like this:</p>
  
  <pre>
  <code>
  &lt;LinearLayout 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:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"&gt;
  
          &lt;TextView android:layout_height="wrap_content"
                    android:layout_width="fill_parent"
                    android:text="Current outages"
                    android:paddingLeft="3sp"
                    android:background="@color/listHeader_Background"
                    android:textColor="@color/listHeader_Foreground"/&gt;
  
          &lt;ListView android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"/&gt;
  
      &lt;/LinearLayout&gt;
      &lt;LinearLayout android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"&gt;
  
          &lt;TextView android:layout_height="wrap_content"
                    android:layout_width="fill_parent"
                    android:paddingLeft="3sp"
                    android:text="Resolved outages"
                    android:background="@color/listHeader_Background"
                    android:textColor="@color/listHeader_Foreground"/&gt;
  
          &lt;ListView android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" /&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code>
  </pre>