How can I display the images in contacts with name and number in a ListView using ArrayAdapter
<p>Please help with this code:</p>

<pre><code>ArrayList&lt;String&gt; detail = new ArrayList&lt;String&gt; () ;
ArrayAdapter&lt;String&gt; adapter;
while (cursor.moveToNext()) {

    String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
    String name = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
    String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));
    if (hasPhone.equalsIgnoreCase("1"))
        hasPhone = "true";
    else
        hasPhone = "false" ;

    if(Boolean.parseBoolean(hasPhone)) {

        Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ contactId,null, null); 

        while (phones.moveToNext()) {

             String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
             detail.add ( name+"\n"+phoneNumber) ; 
             adapter=new ArrayAdapter&lt;String&gt;(this,R.layout.abcd,detail);
             setListAdapter(adapter);
             adapter.notifyDataSetChanged();
        }//end 
        phones.close();
    }
}
</code></pre>
