Androidの連絡先ピッカーを使用してNAMEとNUMBERを取得しようとしています
Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
String[] projection = new String[] { ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.CommonDataKinds.Phone.NUMBER };
String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER + " = '"
+ ("1") + "'";
String[] selectionArgs = null;
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME
+ " COLLATE LOCALIZED ASC";
しかし、残念ながら私は得ています:
android.database.sqlite.SQLiteException: no such column: has_phone_number: , while compiling: SELECT _id, display_name, data1 FROM view_data_restricted data WHERE (1 AND mimetype = 'vnd.android.cursor.item/phone_v2') AND (has_phone_number = '1') ORDER BY display_name COLLATE LOCALIZED ASC