Change:
String selection = ContactsContract.Contacts.DISPLAY_NAME + " IS NOT NULL";
to:
String constraint = "Lau";
String selection =
ContactsContract.Contacts.HAS_PHONE_NUMBER + "=1"
+ " AND "
+ ContactsContract.Contacts.DISPLAY_NAME + " LIKE '%" + constraint + "%'";
![Query Contacts database, selection with AND to combine more cause. thumbnail](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYVsR5WxHwcTgBCRl6ygIbvOs99SCHjiyzdmTEvwFUod0It7ZphyY9Uds6CQmiXwSuYuwxoEePqlteVIndVW0WTpTCV2crXjhpPysmxSyJ7sggKu2845myPrfpFHII4ckb7KhTxKKL7_8O/s72-c/AndroidQueryContacts_04.png)
Title: Query Contacts database, selection with AND to combine more cause.
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 6:32 AM
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 6:32 AM
0 comments:
Post a Comment