1

I am planning to create cursorjoiner for my app. I would like to join the Display name and Email id using the cursorjoiner. I am trying on Android 1.6.

When I query for the Email Id list, I get an exception as :

03-30 13:08:15.609: ERROR/AndroidRuntime(302): Caused by: java.lang.IllegalArgumentException: Invalid column person

My code is as below

String[] projection1 = new String[] {
People._ID,
People.DISPLAY_NAME
} ;

String[] projection2 = new String[] {
    Contacts.ContactMethods.PERSON_ID,
    Contacts.ContactMethods.DATA
} ;

Cursor cur = cr.query(People.CONTENT_URI, projection1, null, null, null);
Cursor emailCur = cr.query( Contacts.ContactMethods.CONTENT_EMAIL_URI, 
                                projection2, 
                                null, null, null); 

I checked the docs it says PERSON_ID is a valid entry.

Also, if I use the same column as a parameter inside a query it works.

emailCur = cr.query( Contacts.ContactMethods.CONTENT_EMAIL_URI,
                     projection2, 
                     Contacts.ContactMethods.PERSON_ID + " = ?", 
                     new String[]{id}, null);

Can any one tell what parameter should I use in projection to achieve this.

animuson
  • 53,861
  • 28
  • 137
  • 147
Vinay
  • 2,395
  • 3
  • 30
  • 35

1 Answers1

0

Contacts is depreciated, use ContactsContract instead.

smith324
  • 13,020
  • 9
  • 37
  • 58
  • I know that it is deprecated starting from 2.0. I am doing for 1.6. Hence it is still active. Kindly let me know any other way of doing this. Thanks – Vinay Mar 31 '11 at 08:11