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

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