Update: my solution in this situation
I do not solve the problem without register LIKE, but I found a solution for my specific situation, and it works even better than I expected :) Maybe this will be useful for you. So, to filter contacts with phones by name, use Phone.CONTENT_FILTER_URI
@Override public Cursor runQuery(CharSequence constraint) { return mContext.getContentResolver().query( Uri.withAppendedPath(Phone.CONTENT_FILTER_URI, Uri.encode(constraint.toString())), //PROJECTION new String[] { Phone._ID, Phone.DISPLAY_NAME, Phone.NUMBER, Phone.TYPE, Phone.PHOTO_ID}, //WHERE ContactsContract.Contacts.HAS_PHONE_NUMBER + " = 1", null, //ORDER BY null); }
This provider performs advanced case-insensitive filtering, and also filters by phone number if the restriction is a number :)
prabhu
source share