我希望根据一组电话号码检索联系人列表。这里出了什么问题?
目前使用这个 -
private String numbers = "'12345', '54321'";
String[] mSelectionArgs = {numbers};'
return new CursorLoader(getActivity(),
PhoneLookup.CONTENT_FILTER_URI,
ContactsQuery.PROJECTION,
ContactsQuery.SELECTION,
mSelectionArgs,
PhoneLookup.DISPLAY_NAME);
PROJECTION 和 SELECTION 在 ContactsQuery 中定义如下
final static String[] PROJECTION = {
PhoneLookup._ID,
PhoneLookup.LOOKUP_KEY,
PhoneLookup.DISPLAY_NAME,
PhoneLookup.PHOTO_THUMBNAIL_URI,
};
final static String SELECTION =
PhoneLookup.HAS_PHONE_NUMBER + "=1 AND " + PhoneLookup.NUMBER) + " IN (?)";
但是,我收到错误:
07-08 00:44:21.007: E/AndroidRuntime(2307): 由: java.lang.IllegalArgumentException: URI: content://com.android.contacts/phone_lookup, 调用用户: com.example.android.contactslist,调用包:com.example.android.contactslist