title: how to get email address from contact list?
body: <p>how to get email address from contact list.below code I got number and name and display on list.but I want number,name and email address so pls check below code</p>
  
  <pre><code> ContentResolver contactResolver = context.getContentResolver();
  
      Cursor c = contactResolver.query(ContactsContract.Contacts.CONTENT_URI, new String[] { ContactsContract.Contacts._ID,
              ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.HAS_PHONE_NUMBER }, null, null, null);
      Cursor cursor = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
              null, null, null);
      if(cursor.getCount()&gt;0)
          while ( cursor.moveToNext()) {
  
              String displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
              String number = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
              // String photoUri = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_THUMBNAIL_URI));
              String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
              //  String lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
  
              Log.e("TAG",  " Name: " + displayName+"==&gt;phone Number==&gt;"+number);
  
              contactNameArrayList.add(displayName);
              contactNumberArrayList.add(number);
  
              if (Integer.parseInt(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0)
              {
  
  
                  Cursor pCur = contactResolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                          null,
                          ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?", new String[] { contactId }, null);
  
  
                  while (pCur.moveToNext())
                  {
                      String phone = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                      String type = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
                      String s = (String) ContactsContract.CommonDataKinds.Phone.getTypeLabel(context.getResources(), Integer.parseInt(type), "");
  
                     // Log.e("TAG", s + " phone: " + phone);
  
                  }
                  pCur.close();
              }
  
              Cursor emailCursor = contactResolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
                      null,
                      null, null, null);
  
              while (emailCursor.moveToNext())
              {
                  String email = emailCursor.getString(emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));
                  int type = emailCursor.getInt(emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE));
                  String s = (String) ContactsContract.CommonDataKinds.Email.getTypeLabel(context.getResources(), type, "");
  
                  Log.e("TAG", s + " email: " + email);
              }
  
              emailCursor.close();
  
          }  cursor.close();
  
  
      Log.e(TAG,"contactNameArrayList sIZE==&gt;"+contactNameArrayList.size()+"contactNumberArrayList size==&gt;"+contactNumberArrayList.size()+"contactEmailAddressArrayList size==&gt;"+contactEmailAddressArrayList.size());
  
  }
  </code></pre>
  
  <p>I create three array for name and number and email id but above code I got only mobile and  name.when I am add name and mobile no in array so simultaneously store email id particular mobile no in email id array.so pls help ...</p>