ListView with rows containing a LinearLayout
<p>I'm trying to implement a list using the ListView, which contains rows built with a LinearLayout. This LinearLayout is composed of a checkbox and a textview. The layout of the row is named tasks_list_row.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="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;CheckBox android:id="@+id/checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" /&gt;
    &lt;TextView android:id="@android:id/text1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>Then from my code I initialize the list this way:</p>

<pre><code>final String[] items_task = new String[] { "one",
                "two",
                "three" };

setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.tasks_list_row, items_task));
</code></pre>

<p>But then I get an error:
<strong>ArrayAdapter - You must supply a resource ID for a TextView</strong></p>

<p>I then try to specify the TextView id this way:</p>

<pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.id.text1, R.layout.tasks_list_row, items_task));
</code></pre>

<p>But I get a Resource not found error (R.id.text1 exists in the R.java file).</p>

<p>What should I do?</p>
