I know how to create an intent to let the contacts app display a specific contact:
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, mMyLookupKey);
intent.setData(uri);
startActivity(intent);
I also know how to create an intent to ask the contacts app to let me PICK a phone number:
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI)
// Explicitly set the 'type' to 'phone numbers' //
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
startActivityForResult(intent, REQUEST_PHONENR);
Just now I have been trying to combine these to make it possible to pick a phone number from a specific contact:
Intent intent = new Intent(Intent.ACTION_PICK);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, mMyLookupKey);
intent.setData(uri);
// Explicitly set the 'type' to 'phone numbers'
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
startActivityForResult(intent, REQUEST_PHONENR);
Does somebody know is this is possible?