ContactsContract和ContentResolver - WHEN是否为游标?

时间:2015-07-09 08:28:15

标签: android android-contentresolver contactscontract

我使用下面的光标从手机中检索联系人:

String[] selection = new String[]
            {
                    ContactsContract.Data.RAW_CONTACT_ID,
                    ContactsContract.Data.CONTACT_ID,
                    ContactsContract.Data.LOOKUP_KEY,
                    ContactsContract.Data.PHOTO_ID,
                    ContactsContract.Data.DISPLAY_NAME,
                    ContactsContract.Data.ACCOUNT_TYPE_AND_DATA_SET,
                    ContactsContract.CommonDataKinds.Phone.NUMBER,
                    ContactsContract.CommonDataKinds.Phone.TYPE,
                    ContactsContract.CommonDataKinds.Phone.LABEL,
                    ContactsContract.Contacts.Data.MIMETYPE,
                    ContactsContract.RawContacts.ACCOUNT_NAME
            };

    Cursor cursor = context.getContentResolver().query(
            ContactsContract.Data.CONTENT_URI,//ContactsContract.CommonDataKinds.Phone.CONTENT_URI
            selection,
            null,//Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
            null,
            ContactsContract.Data.CONTACT_ID + " ASC");

null cursor是什么意思?

  • 失败了?如果是这样,什么?权利?还是其他什么?
  • 用户没有任何联系人?

0 个答案:

没有答案