1
如何將照片限制在最高50?我還會在這裏得到最近的記錄嗎?android - 光標限制照片
final String[] projection = { MediaStore.Images.Media.DATA };
final String selection = MediaStore.Images.Media.BUCKET_ID + " = ?";
final String[] selectionArgs = { CAMERA_IMAGE_BUCKET_ID };
final Cursor cursor = context.getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI,
projection,
selection,
selectionArgs,
null);
List<Image> result = new ArrayList<Image>(cursor.getCount());
if (cursor.moveToFirst()) {
final int dataColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
do {
final String data = cursor.getString(dataColumn);
result.add(new Image(data));
} while (cursor.moveToNext());
}
cursor.close();
預先感謝您
照片不得不被視爲「前50名」的標準是什麼? –