Android: is forcing to use ListView
<p>I want to make a menu, which contains 4 different LinearLayouts.
Top one has title, second one has description, the third one has 3 ImageViews, which have event onClick, and the fourth one has a Button which also has onClick event.</p>

<p>Somehow, android doesn't like it, and forcing me to use ListView.</p>

<p>The exception message is: <strong>java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</strong></p>

<p>I have already tried to use ListView, and it didn't work as I expected. For example, the 3rd layout, which has 3 buttons, the events are not working for each ImageView, but instead on the row of the ListView.</p>

<p>What can be done?</p>

<p>Displaying my layouts xml files:</p>

<p><strong>options.xml</strong></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" android:id="@+id/optionsLayout"
    android:background="@drawable/bg" android:layout_gravity="center"&gt;

    &lt;include  layout="@layout/options_layout1" android:id="@+id/optionsLayout1" /&gt;
    &lt;include  layout="@layout/options_layout2" android:id="@+id/optionsLayout2" /&gt;
    &lt;include  layout="@layout/options_layout3" android:id="@+id/optionsLayout3" /&gt;
    &lt;include  layout="@layout/options_layout4" android:id="@+id/optionsLayout4" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p><strong>options_layout1.xml</strong></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="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/optionsTitleLayout"
    android:background="@drawable/options" 
    android:layout_gravity="center" /&gt;
</code></pre>

<p><strong>options_layout2.xml</strong></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="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/chooseThemeTitleLayout"
    android:background="@drawable/choose_theme" android:layout_gravity="center" 
    android:layout_marginTop="70dip" /&gt;
</code></pre>

<p><strong>options_layout3.xml</strong></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="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/optionButtonsLayout" 
    android:layout_gravity="center" android:layout_marginTop="10dip" &gt;
    &lt;ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:id="@+id/theme1Btn"
        android:background="@drawable/theme1_off" android:layout_marginLeft="10dip" 
        android:layout_marginRight="10dip" /&gt;
    &lt;ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerInParent="true"
        android:id="@+id/theme2Btn" android:background="@drawable/theme2_off" 
        android:layout_marginLeft="10dip" android:layout_marginRight="10dip" /&gt;
    &lt;ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_toRightOf="@id/theme2Btn"
        android:id="@+id/theme3Btn" android:background="@drawable/theme3_off" 
        android:layout_marginLeft="10dip" android:layout_marginRight="10dip"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p><strong>options_layout4.xml</strong></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="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/saveButtonLayout"
    android:layout_gravity="center" &gt;
    &lt;Button android:id="@+id/saveBtn" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerHorizontal="true"
        android:text="Save" android:layout_marginTop="10dip"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>Thanks,
Henry.</p>
