title: Android ExpandableListView not expanding in Linearlayout
body: <p>I'm working on a layout but i have problems with two <code>ExpandableListView</code>. I've developed my layout using a lot of LinearLayout, it works but the lists doesn't expand because they doesn't heve the space.Now the lists height is to "fill parent" but if i change it to a number like "200dp" they have the space to expand:</p>
  
  <p><img src="https://i.stack.imgur.com/Rdtzh.png" alt="enter image description here"></p>
  
  <p>How can I fix this? I don't want to keep a number because when the list is closed remains a white space...That's my xml code:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="match_parent"
              android:orientation="vertical" &gt;
              &lt;LinearLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                  &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/attack" android:textAppearance="?android:textAppearanceLarge" android:textColor="@color/black" /&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/lance1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/lance" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/lance_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/espadas1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/spade" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/espadas_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/archi1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/archi" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/archi_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/balestre1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/balestre" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/balestre_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/cp1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/cp" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/cp_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/cl1" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/cl" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/cl_attacco" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
                  &lt;ExpandableListView
                      android:id="@+id/List"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent" &gt;
                  &lt;/ExpandableListView&gt;
              &lt;/LinearLayout&gt;
              &lt;TextView android:textAppearance="?android:textAppearanceLarge" android:textColor="@color/black" android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/defense" /&gt;
              &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/lance" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/lance" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/lance_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/espadas" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/spade" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/espadas_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/archi" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/archi" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/archi_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/balestre" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/balestre" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/balestre_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
                  &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/cp" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/cp" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/cp_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
                          &lt;ImageView android:id="@+id/cl" android:layout_width="wrap_content" android:layout_height="45.0dip" android:src="@drawable/cl" android:adjustViewBounds="true" /&gt;
                          &lt;EditText android:id="@+id/cl_difesa" android:layout_width="73.0dip" android:layout_height="wrap_content" android:ems="10" android:inputType="numberDecimal" /&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
              &lt;ExpandableListView
                  android:id="@+id/List1"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent" &gt;
  
                  &lt;/ExpandableListView&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks, Giacomo.</p>