| Author |
How to query for contacts information? Docs are not updated to 2.2
|
James Elsey
Ranch Hand
Joined: Dec 21, 2007
Posts: 228
|
|
Hello
I'm working my way through the tutorials on the Android website, I'm looking at the contacts manager
I've also checked out the sample code for this.
I am trying to use managedQuery to obtain various columns of data, such as name, email, postal code.
I have the following snippet of code for doing this, but its currently throwing an error in eclipse
The error that I can gather from LogCat is as follows, not sure how relevant it is to this issue :
I've checked the documenation/examples on the documentation website, but it seems it is out of date (suggests to use deprecated methods and such)
Can anyone please help me with the above code snippet? I can get it to work if I only display ContactsContract.Contacts.DISPLAY_NAME
Regards
|
Kind Regards, James. OCPJP 1.6 || My SCJP / OCJCP Study Notes
Interested in : SCJP, Google App Engine, Stripes, Android;|| My Bite-Size SCJP Study Blog
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
If you want to get the Name and Email of contacts, then you can use ContactsContract.CommonDataKinds.Email content provider instead of ContactsContract.Contacts provider. See this tutorial too...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: How to query for contacts information? Docs are not updated to 2.2
|
|
|