ArrayList<String> contacts_list = new ArrayList<String>();
Cursor c = getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
null, null, null);
while (c.moveToNext()) {
contactName = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
PhoneNumber = c
.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
contacts_list.add("ContactName:"+contactName + "\n" +"ContactNumber:"+PhoneNumber );
}
c.close();
In above code,getting the name and phone number but not separating the arraylist of contact number and names