Skip to content Skip to sidebar Skip to footer

Logcat Says "invalid Column Data1"

New to threading. New to SQL. New to getting Contact Info. So of course I'm lost. If I'm reading this logcat correctly, it's telling me that either: column data1 doesn't exist,

Solution 1:

To retrieve phone numbers, query Phone.CONTENT_URI and include Phone.NUMBER in your projection.

To retrieve email addresses, query Email.CONTENT_URI and ask for Email.DATA in your projection.

Either of those will also allow you to include Contacts.DISPLAY_NAME in your projection as well, as some common columns like that are automatically joined in.

While I have not retrieved this data by ID before, I believe that your "where clause" would be Phone.CONTACT_ID + " = " + contactId and Email.CONTACT_ID + " = " + contactId respectively. See How to get contacts' phone number in Android for more.

Solution 2:

replacingContactsContract.CommonDataKinds.Phone.NUMBER with ContactsContract.PhoneLookup.NORMALIZED_NUMBER may help. Logcat says column name "data1" is invalid.

Post a Comment for "Logcat Says "invalid Column Data1""