Last exercise "Query Contacts database" for all contacts. If you want to query contacts with phone number only, simple change the selection:
Change:
String selection = ContactsContract.Contacts.DISPLAY_NAME + " IS NOT NULL";
to:
String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER + "=1";
![Query Contacts database for contacts with phone number only Query Contacts database for contacts with phone number only](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjUzNfNhN9dcXzX2w_z3DBf-kSXsUT_khnI77s6Y6uNv1P0Yb1z79un0OR9MSSbfBpSB_Dh1OY5guksypU_4Yfq6JAvkIl6Y8pfqVj96WQ7JdQvheT_fKyhYO9GD4Ebyvton29XFfV9crP/s400/AndroidQueryContacts_02.png)
0 تعليقات