I found on SO that to launch a filtered version of contact picker (which only shows contacts that have phone numbers), I can just use this:
Intent pickContactIntent = new Intent( Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI );
pickContactIntent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
startActivityForResult(pickContactIntent, CONTACT_PICKER_RESULT);
So this works. I'm just trying to figure out how to retrieve the name and phone number of the selected contact now, within the onActivityResult method:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// what goes here...
}
I've tried a number of different things inside onActivityResult, but the queries don't return the number.