3

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?

acrespo
  • 1,134
  • 1
  • 10
  • 33
  • Did you find the reason? I'm getting the same error. – FCA Mar 04 '16 at 07:07
  • 1
    Nope :(. Are you seeing the EXACT same error? On what devices and android versions? I honestly gave up on this one :(. It isn't that frequent, I'm guessing some manufacturers do custom stuff that get exposed in the versions I mentioned. – acrespo Mar 04 '16 at 14:08
  • 1
    Yes, it's pretty much the same error happening on Xperia Z running Android 5.1.1. – FCA Mar 04 '16 at 20:41

0 Answers0