Created
June 3, 2012 14:38
-
-
Save liuyix/2863773 to your computer and use it in GitHub Desktop.
getting whole phone numbers and names of contacts in android | [Chinese] 获得所有联系人名字和号码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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