title: android simple cursor adapter imageview and textview
body: <p>I have the following code:</p>
  
  <pre><code>m_curContacts = managedQuery(uri, projection, selection, selectionArgs,
                      sortOrder);
  String[] fields = new String[] { ContactsContract.Data.DISPLAY_NAME };
  m_slvAdapter = new SimpleCursorAdapter(this,
              R.layout.list, m_curContacts, fields,
              new int[] { R.id.textview });
  </code></pre>
  
  <p>The layout R.layout.list has 2 elements: a textview and an imageview. I would like to ask how can I add in the m_slvAdapter the imageview? </p>
  
  <p>How to add the following:</p>
  
  <pre><code>Uri[] photo = new Uri[] {
       Uri.withAppendedPath(ContentUris.withAppendedId 
           (ContactsContract.Contacts.CONTENT_URI,getContentResolver().query
           (ContactsContract.Contacts.CONTENT_URI,null,  
            ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'", null, 
            ContactsContract.Contacts.DISPLAY_NAME+" COLLATE LOCALIZED ASC")
           .getLong(getContentResolver()
           .query(ContactsContract.Contacts.CONTENT_URI,null, 
            ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'", null, 
            ContactsContract.Contacts.DISPLAY_NAME+" COLLATE LOCALIZED ASC")
           .getColumnIndex(ContactsContract.Contacts._ID))), 
            ContactsContract.Contacts.Photo.CONTENT_DIRECTORY)
  };
  </code></pre>
  
  <p>I want to add near fields and </p>
  
  <pre><code>new int[]{R.id.contact} 
  </code></pre>
  
  <p>the photo and </p>
  
  <pre><code>new Uri[] { 
      contactimage.setImageResource(R.drawable.image);
  }
  </code></pre>
  
  <p>or something similar.</p>