I am using the following query and expecting to retrieve only contacts
with at least one phone number. However, I *am* getting contacts with
zero phone numbers. Should this constant be renamed
MAYBE_HAS_PHONE_NUMBER? :)
@Override
public ListAdapter getAdapter(Activity activity) {
String[] PROJECTION = new String[] { Contacts._ID,
Contacts.DISPLAY_NAME };
Cursor c = activity.managedQuery(Contacts.CONTENT_URI,
PROJECTION,
ContactsContract.CommonDataKinds.Phone.HAS_PHONE_NUMBER + "='1'",
null, Contacts.DISPLAY_NAME);
activity.startManagingCursor(c);
ListAdapter adapter = new SimpleCursorAdapter(activity,
android.R.layout.simple_list_item_multiple_choice, c,
new String[] { Contacts.DISPLAY_NAME },
new int[] { android.R.id.text1 });
return adapter;
}
Peace,
Scott
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en