I take that back.  I actually don't know if that query will work or
not.  I always just use ContactsContract.Contacts.CONTENT_URI and give
it a WHERE clause and a key and it works with the CONTACT_ID column.



On May 23, 3:23 pm, Zsolt Vasvari <[email protected]> wrote:
> Your query will return the entire contacts database since you don't
> have a WHERE clause and a key.
>
> On May 23, 3:03 pm, b_t <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I try to pick a contact number by:
>
> >                 Intent intent = new Intent(Intent.ACTION_PICK,
> > Contacts.CONTENT_URI);
>
> > intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
>
> > And I try to get a contact from the result by:
>
> >                 Uri contactData = intent.getData();
>
> >                 ContentResolver cr = getContext().getContentResolver();
> >                 Cursor c = cr.query(uri, new String[] { Data.CONTACT_ID,
> > Data.LOOKUP_KEY, Phone.NUMBER }, null, null, null);
>
> > And in some devices or for some contacts it throws:
>
> >                 java.lang.IllegalArgumentException: Invalid column
> > contact_id
>
> > The URI is for example:
>
> >                 
> > content://com.android.contacts/contacts/lookup/812i70704be008e61b18/694
>
> > Is it possible that CONTACT_ID column doesn't exist?
>
> > Thanks, Tamás- Hide quoted text -
>
> - Show quoted text -

-- 
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

Reply via email to