我正在使用通用图像加载器在网格中显示SD卡图像
我正在使用以下代码。
this.imageUrls = new ArrayList<String>();
//int dataColumnIndex = imagecursor.getColumnIndex(MediaStore.Images.Media.DATA);
int image_column_index = imagecursor.getColumnIndex(MediaStore.Images.Thumbnails._ID);
for (int i = 0; i < imagecursor.getCount(); i++) {
imagecursor.moveToPosition(i);
Cursor cursor = MediaStore.Images.Thumbnails.queryMiniThumbnail(
getContentResolver(), Long.valueOf(imagecursor.getString(image_column_index)),
MediaStore.Images.Thumbnails.MINI_KIND,
null );
if( cursor != null && cursor.getCount() > 0 ) {
cursor.moveToFirst();//**EDIT**
String uri = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Thumbnails.DATA));
imageUrls.add(uri);
}
}
它没有加载所有缩略图,当我检查Android工作室日志时,我多次看到类似的异常
java.io.FileNotFoundException: /storage/emulated/0/DCIM/.thumbnails/1445029040607.jpg: open failed: ENOENT (No such file or directory)
01
我哪里出错了?