Some users are reporting that I'm using the wrong email address when
sending a mail to a contact from my app. I can't repro that locally,
so I'm at a loss at how that could happen.
Here is roughly what I do:
Uri uri = ContentUris.withAppendedId(Contacts.People.CONTENT_URI,
contactId);
// Note: Users have confirmed that ACTION_VIEW on the uri shows them
the right contact.
Cursor mailCursor = getContentResolver().query(Uri.withAppendedPath
(uri, Contacts.People.ContactMethods.CONTENT_DIRECTORY), new String[]
{ Contacts.ContactMethods.DATA }, Contacts.ContactMethods.KIND + "=" +
Contacts.KIND_EMAIL, null, null);
if (mailCursor.moveToFirst()) {
String address = mailCursor.getString(0);
Intent mailIntent = new Intent(Intent.ACTION_SEND);
String[] tos = { address };
mailIntent.putExtra(Intent.EXTRA_EMAIL, tos);
mailIntent.setType("message/rfc882");
...etc..
How can this get me the email address of the wrong contact?! Yeah, I
just pick the first address that's available, but it should be the
right contact.
-Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---