Akan salah jika :
android.database.sqlite.SQLiteException: near "%":
syntax error: , while compiling:
SELECT ... FROM ...
WHERE ((display_name like %?%))
ORDER BY display_name ASC
SOLUSINYA:
Cursor contactsContractContacts = resolver.query(
ContactsContract.Contacts.CONTENT_URI, projection,
ContactsContract.Contacts.DISPLAY_NAME + " like ?",
new String[]{"%" + filterStr + "%"},
ContactsContract.Contacts.DISPLAY_NAME + " ASC");
Tidak ada komentar:
Posting Komentar