title: Android get a cursor only with contacts that have an email listed >android 2.0
body: <p>i have the following code to get contacts from <code>content provider</code></p>
  
  <pre><code>String[] columns = new String[] {
                  ContactsContract.Contacts.DISPLAY_NAME,
                  ContactsContract.Contacts._ID,
                  ContactsContract.Contacts.PHOTO_ID };
          Cursor cursor = managedQuery(ContactsContract.Contacts.CONTENT_URI,
                  columns, null, null, null);
  </code></pre>
  
  <p>and i use this one to get the emails for a specific contact by their id:</p>
  
  <pre><code>Cursor emails = getContentResolver().query(
                      ContactsContract.CommonDataKinds.Email.CONTENT_URI,
                      null,
                      ContactsContract.CommonDataKinds.Email.CONTACT_ID
                              + " = " + contact.getContactId(), null, null);
  </code></pre>
  
  <p>my current implementation passes every row in the cursor and aquires its emails and stores them in an arrayList of java objects.</p>
  
  <p>what i was wondering if it was possible to do is just query the content provider and return a cursor of just contacts with ids/name etc that have an email address listed. </p>
  
  <p>this way has a long waiting period for getting the contact list. i am using this list for a list adapter. if i can get only the contacts that have an email i can use a cursor adapter in my list.</p>
  
  <p>Is something like this possible? how can i speed up the process?</p>