title: Android - ListView within a ListView does not expand to show all items
body: <p>I have a listview of items that have a listview as a child.  My problem is that the child listview does not expand to show all items.</p>
  
  <p>Parent layout</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:padding="0px"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:id="@+id/site_wallet_header"
          style="@style/Home.ListHeader" /&gt;
  
      &lt;ListView 
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/site_wallet_list" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Child layout</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      style="@style/ListItem"
      android:layout_gravity="center_vertical"
      android:gravity="center"&gt;
  
      &lt;ImageView
          android:id="@+id/bank_icon"
          android:layout_height="wrap_content"
          android:layout_width="0dip"
          android:layout_weight="1" /&gt;
  
      &lt;TextView
  
          android:id="@+id/bank_name"
          android:layout_height="wrap_content"
          android:layout_width="0dip"
          android:layout_weight="4"
          style="@style/ListItem.Text"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Parent collection <code>ArrayAdapter</code></p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
      View v = convertView;
      if (v == null) {
          LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          v = vi.inflate(resourceId, null);
      }
  
      AccountSummary account = accounts.get(position);
  
      if (account != null) 
      {
          TextView header = (TextView) v.findViewById(R.id.site_wallet_header);
          header.setText(account.Name);
  
          if (account.Banks.length == 0) {
              //LinearLayout noBanks = (LinearLayout) context.getLayoutInflater().inflate(R.layout.no_banks, null);
          } else {
              ListView banksList = (ListView) v.findViewById(R.id.site_wallet_list);
              //banksList.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
  
              banksList.clearChoices();
              banksList.setAdapter(new BankSummaryAdapter(context, R.layout.list_item_bank, account.Banks));
          }
      }
  
      return v;
  }
  </code></pre>
  
  <p>Child collection <code>ArrayAdapter</code></p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
      View v = convertView;
      if (v == null) {
          LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          v = vi.inflate(resourceId, null);
      }
  
      BankSummary bank = items.get(position);
  
      if (bank != null) 
      {
          TextView nameText = (TextView) v.findViewById(R.id.bank_name);
          ImageView iconImage = (ImageView) v.findViewById(R.id.bank_icon);
  
          nameText.setText(bank.DisplayName);
  
          Resources res = context.getResources();
  
  
          switch (bank.BankCode)
          {
              case 'V':
                  iconImage.setImageDrawable(res.getDrawable(R.drawable.ic_visa));
                  break;
              case 'M':
                  iconImage.setImageDrawable(res.getDrawable(R.drawable.ic_mastercard));
                  break;
              case 'D':
                  iconImage.setImageDrawable(res.getDrawable(R.drawable.ic_discover));
                  break;
              case 'A':
                  iconImage.setImageDrawable(res.getDrawable(R.drawable.ic_american_express));
                  break;
              default:
                  iconImage.setImageDrawable(res.getDrawable(R.drawable.ic_echeck));
                  break;
          }
      }
  
      return v;
  }
  </code></pre>
  
  <p>Here is what it is doing.</p>
  
  <p><img src="https://i.stack.imgur.com/cWNz3.jpg" alt="frustration"></p>
  
  <p>My goal here is to have these header lists that are loaded dynamically.  This screen will be scrollable with the child lists always showing every item.  No matter what I try, however, I can't seem to get the child list to expand completely.  I really want to avoid building the entire thing in code.</p>