android 获取手机联系人

 
  
 
  
ContentResolver contentResolver = getContentResolver();
Cursor cursor =getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
        null, null, null, null);
while (cursor.moveToNext()){
    String name = cursor.getString(cursor
            .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
    //读取通讯录的号码
    String number = cursor.getString(cursor
            .getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

}

你可能感兴趣的:(android 获取手机联系人)