I want to set a query to get names which cointain the a particular string (here constraint).
SO I coded:
Cursor contactCursor = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, new String[]{Phone.DISPLAY_NAME}, Phone.DISPLAY_NAME + "like + ?", new String[]{"%"+constraint+"%"}, Phone.DISPLAY_NAME + " ASC");
But I get en error.
I know that I’m close.
Where I’m wrong?
You have a simple typo. Change this:
to this:
(add a space in the front and remove the
+).