Skip to content

Instantly share code, notes, and snippets.

@liuyix
Created June 3, 2012 14:38
Show Gist options
  • Select an option

  • Save liuyix/2863773 to your computer and use it in GitHub Desktop.

Select an option

Save liuyix/2863773 to your computer and use it in GitHub Desktop.
getting whole phone numbers and names of contacts in android | [Chinese] 获得所有联系人名字和号码
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null);
while (phones.moveToNext())
{
String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
}
phones.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment