1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Match beginning of words when searching for contacts in Android 1.5/1.6 (e.g. "Doe" will find "Doe, John" and "John Doe")

Fixes issue 1354
This commit is contained in:
cketti 2010-10-30 20:53:56 +00:00
parent 0add1f97c0
commit 7f396e29a0

View File

@ -145,10 +145,13 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
" AND" + "(" + " AND" + "(" +
Contacts.People.NAME + " LIKE ?" + Contacts.People.NAME + " LIKE ?" +
") OR (" + ") OR (" +
Contacts.People.NAME + " LIKE ?" +
") OR (" +
Contacts.ContactMethods.DATA + " LIKE ?" + Contacts.ContactMethods.DATA + " LIKE ?" +
")"; ")";
final String filter = constraint.toString() + "%"; final String filter = constraint.toString() + "%";
args = new String[] {filter, filter}; final String filter2 = "% " + filter;
args = new String[] {filter, filter2, filter};
} }
final Cursor c = mContentResolver.query( final Cursor c = mContentResolver.query(