获取电话簿:联系人和号码

ContentResolver cr=this.getContentResolver(); 
Cursor cursor=cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); 
while (cursor.moveToNext()) { 
        //取得联系人名字 
        int nameFieldColumnIndex=cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME); 
        String contact=cursor.getString(nameFieldColumnIndex); 
        //取得电话号码 
        int numberFieldColumnIndex=cursor.getColumnIndex(PhoneLookup.NUMBER); 
        String number=cursor.getString(numberFieldColumnIndex); 

你可能感兴趣的:(获取电话簿:联系人和号码)