Android: ListView with multiple choice and subitems enabled
<p>I'm trying to get my contacts on a list view. Now I know that using <code>simple_list_item_multiple_choice</code> enables me to select multiple contacts, but it views names only without numbers.</p>

<p>On the other side, <code>simple_list_item_2</code> can be used to show both name and number, but supports selection of only one contact.</p>

<p>Is there any template that combine them both? If not, how could I build my customized list with both features?</p>

<p>EDIT: This is the code I'm using</p>

<pre><code>CursorLoader cl = new CursorLoader(this,ContactsContract.CommonDataKinds.Phone.CONTENT_URI, PROJECTION, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME+" ASC");
Cursor c = cl.loadInBackground();
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_multiple_choice, // Use a template
                                                         // that displays a
                                                         // text view
                    c, // Give the cursor to the list adapter
                    new String[] { ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME},
                    new int[] { android.R.id.text1},0); 

setListAdapter(adapter);
</code></pre>

<p>Here, the second parameter of SimpleCursorAdapter is <code>simple_list_item_multiple_choice</code> but it supports only dealing with <code>android.R.id.text1</code>. So I can use items only, not subitems.</p>

<p>But in the following code</p>

<pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_expandable_list_item_2, // Use a template
                                                         // that displays a
                                                         // text view
                    c, // Give the cursor to the list adapter
                    new String[] { ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ,ContactsContract.CommonDataKinds.Phone.NUMBER},
                    new int[] { android.R.id.text1,android.R.id.text2},0); 
</code></pre>

<p>I can give it both <code>ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME</code> and <code>NUMBER</code> to be written in <code>android.R.id.text1</code> and <code>android.R.id.text2</code>, but can't use multiple choice feature.</p>
