The previous exercise demonstrate how to "Query Contacts database" for all contacts. To search for contacts with certain constraint in DISPLAY_NAME, we can modify the selection using LIKE cause.
Change:
String selection = ContactsContract.Contacts.DISPLAY_NAME + " IS NOT NULL";
to:
String constraint = "Lau";
String selection = ContactsContract.Contacts.DISPLAY_NAME + " LIKE '%" + constraint + "%'";
Home »
» Query Contacts database, search with selection of LIKE cause.
Query Contacts database, search with selection of LIKE cause.
Written By MR HARI on Selasa, 27 November 2012 | 07.23
Related Articles
If you enjoyed this article just click here, or subscribe to receive more great content just like it.

0 komentar:
Posting Komentar