@Override protected void openCursor(ImageData data) { log(TAG, "opening single album"); String[] projection = { MediaStore.Images.Media.DATA, MediaStore.Images.Media.ORIENTATION, MediaStore.Images.Media.BUCKET_ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME }; String selection = MediaStore.Images.Media.BUCKET_ID + " = '" + data.albumId + "'"; data.cursor = mResolver.query(data.uri, projection, selection, null, null); }
@Override protected ImageData unpackImageData(Cursor cursor, ImageData data) { if (data == null) { data = new ImageData(); } int dataIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); int orientationIndex = cursor.getColumnIndex(MediaStore.Images.Media.ORIENTATION); int bucketIndex = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID); data.url = cursor.getString(dataIndex); data.albumId = cursor.getString(bucketIndex); data.position = UNINITIALIZED; data.cursor = null; data.orientation = cursor.getInt(orientationIndex); return data; }