You can open the cursor on contacts and launch through contacts with phone numbers. You could recreate the activity of selecting contacts, which is shown with the intention that you spoke about using this cursor (dropping them into the list to select)
ContentResolver cr = getContentResolver();
Cursor phoneCur = cr.query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
null,
null,
null);
while (phoneCur.moveToNext()) {
String phone = phoneCur.getString(
phoneCur.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.DATA));
//do something, check if empty...
}
phoneCur.close();
with this approach, you will also need permission to read the contact in your manifest
<uses-permission android:name="android.permission.READ_CONTACTS"/>
source
share