Error In Looking Up A Contact Android
I am getting an error when I want to access the a specific contact. java.lang.IllegalArgumentException: Invalid column contact_id Here is the sample code: String number = '087777
Solution 1:
Just change ContactsContract.PhoneLookup.CONTACT_ID
to ContactsContract.PhoneLookup._ID
.
The _ID
in PhoneLookup
simply mean the CONTACT_ID
See here: https://developer.android.com/reference/android/provider/ContactsContract.PhoneLookup.html
Solution 2:
Use ContactsContract.CommonDataKinds.Phone.CONTENT_URI
instead of ContactsContract.PhoneLookup.CONTACT_ID
Post a Comment for "Error In Looking Up A Contact Android"