It returns only one row for a selected phone number. The URI contains
the condition after the lookup key.
This URI is returned by the phone number selection activity.

On May 23, 9:39 am, Zsolt Vasvari <zvasv...@gmail.com> wrote:
> 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 <zvasv...@gmail.com> 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 <bartata...@gmail.com> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to