Friday, November 20, 2009

[android-developers] Re: How to get all contact's name phone number, email for 2.0

Rachel:

Your following query is working perfectly for a single contact.
Cursor emails = getContentResolver().query(

ContactsContract.CommonDataKinds.Email.CONTENT_URI,
null,
ContactsContract.CommonDataKinds.Email.CONTACT_ID
+ " = " + contactId,
null, null);

However, If I want to get all the contact emails, I will remove the
selection and query is
Cursor emails = getContentResolver().query(

ContactsContract.CommonDataKinds.Email.CONTENT_URI,
null,
null,
null, null);
Now, it always return just one row. I tried several ways, like
ContactsContract.CommonDataKinds.Email.CONTACT_ID + " in ('1', '2',
'3');
It always one row. If I just contact id "3", it will return contact
3.
Do you know a way to get all the emails in one single query?

Thanks a lot for your help, and your suggestion to put sample projects
for 2.0 contact api is
really helpful.

Henry


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate