After a considerable amount of research I'm throwing this to see if it catches something.
Im trying to query the Android's phone_lookup
table to try and get some extra data from a phone number (lookup_key, photo_thumb_uri, etc...).
Here's my query:
String[] projection = {Contacts._ID, Contacts.LOOKUP_KEY, Utils.hasHoneycomb() ?
Contacts.DISPLAY_NAME_PRIMARY : Contacts.DISPLAY_NAME, Utils.hasHoneycomb() ?
Contacts.PHOTO_THUMBNAIL_URI : Contacts._ID};
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phone.getNumber()));
Cursor cs = context.getContentResolver().query(uri, projection, null, null, null);
In many cases, it works just fine and I get away with it. But unfornatunately, I've seen several reports of this error:
java.lang.IllegalArgumentException: column 'data1' does not exist at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167) at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at
android.content.ContentProviderProxy.query(ContentProviderNative.java:366) at
android.content.ContentResolver.query(ContentResolver.java:373) at
android.content.ContentResolver.query(ContentResolver.java:316) at
This is has only been reported for Android versions 4.2.2, 4.4.2 and 5.1, in that order of "frecuency precedence" (Not sure if it helps).
What leaves me thinking is... I'M NOT PROJECTING for any data1
column. I'm not trying to get ContactsContract.CommonDataKinds.Email.DATA
or ContactsContract.CommonDataKinds.Phone.Number
(as I do in other queries, to other tables). So what am I missing? Are there any implicit joins I'm not seeing?