是否可以使用自定义列名而不是内容提供者提供的那些来获取光标?
我尝试以下
private final String[] PROJ_CONTACT = {
ContactsContract.CommonDataKinds.Email.DISPLAY_NAME_PRIMARY + " AS " + Golfer.COLUMN_NAME,
ContactsContract.CommonDataKinds.Email.ADDRESS + " AS " + Golfer.COLUMN_EMAIL
};
ContentResolver resolver = getActivity().getContentResolver();
Cursor cursor = resolver.query(
ContactsContract.CommonDataKinds.Email.CONTENT_URI,
PROJ_CONTACT,
SELECTION_BY_ID,
new String[] {Long.toString(id)},
null);
但我得到了例外07-12 17:02:01.733: E/AndroidRuntime(7569): java.lang.IllegalArgumentException: Invalid column display_name AS name