我目前有以下代码从通讯录中检索联系人:
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection = {
ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME
};
String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'";
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
Cursor cursor = getContentResolver().query(uri, projection, selection, null, sortOrder);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_multiple_choice,
cursor,
new String[] {ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts._ID},
new int[] { android.R.id.text1},0);
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
setListAdapter(adapter);
但是,这也会在我的 Nexus 4 上返回我的 facbook 联系人。我的选择有问题吗?
谢谢