title: Inflating a ListView with different number of ImageViews in each row
body: <p>I'm starting to work with the Android LayoutInflater and I need some help.</p>
  
  <p>I have a ListActivity which uses a layout defined in the following XML:</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;ListView
          android:id="@+id/android:list"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This ListView is filled with an ArrayAdapter which generates each row by inflating another XML like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="?android:attr/listPreferredItemHeight"
      android:padding="6dip"
      &gt;
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="0dip"
          android:layout_weight="1"
          android:layout_height="fill_parent"
          &gt;
          &lt;TextView
              android:id="@+id/item_text"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:gravity="center_vertical"
              android:textSize="20dip"
              android:textColor="#FFF"
          /&gt;
          &lt;ImageView
              android:id="@+id/item_icon"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:layout_marginRight="6dip"
              android:src="@drawable/example_icon"
          /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is working fine, but now I want to show a variable number of icons for each item (so, each row of the ListView could have a different number of ImageViews under the TextView).</p>
  
  <p>Maybe I have to define another XML for the list of icons and somehow build the ListView from nested layouts? I don't know what's the better way to do this. Any suggestions?</p>
  
  <p>Thank you!</p>
  
  <p>Edit: This is an example of what im trying to do: <a href="http://tinypic.com/r/2s9yniw/7" rel="nofollow">http://tinypic.com/r/2s9yniw/7</a></p>