• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to query for contacts information? Docs are not updated to 2.2

 
Ranch Hand
Posts: 231
Android IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic