How to call Android contacts list?

前端 未结 13 1996
傲寒
傲寒 2020-11-22 02:50

I\'m making an Android app, and need to call the phone\'s contact list. I need to call the contacts list function, pick a contact, then return to my app with the contact\'s

13条回答
  •  名媛妹妹
    2020-11-22 03:20

            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 Number=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
    
            }
    

提交回复
热议问题