I'd like to pick an email from the contacts list. Picking a contact is not good enough, because a contact can have several emails.
Using the API demo, I managed to pick a contact, phone number and even an address. Example:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
// OR
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
// OR
intent.setType(ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
BUT, when trying to pick an email
intent.setType(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE);
I get activity not found exception.
Any idea on how to pick an email from the all the contacts' emails?
Thanks. Alik.
Update (2011/05/02): Found another way to pick things from the contacts but still the email picker is not registered to the intent.
Working:
new Intent(Intent.ACTION_PICK,ContactsContract.Contacts.CONTENT_URI);
new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_URI);
NOT working:
new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);