我使用此代码在 Sdcard 上加载缩略图,设备运行良好,但使用设备使用 rom MIUI 则出现问题“异常详细信息:java.lang.IllegalStateException:进程 3188 超出光标配额 100,将杀死它”
请帮我修一下,谢谢。
public static Bitmap getThumbnailByPath(ContentResolver cr, String path)
throws Exception {
String[] projection = { MediaStore.Images.Media._ID };
Cursor cursor = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
projection, MediaStore.Images.Media.DATA + "=?",
new String[] { path }, null);
if (cursor != null && cursor.moveToFirst()) {
long id = cursor.getLong(0);
return getThumbnailById(cr, id);
} else
cursor.close();
return null;
}
public static Bitmap getThumbnailById(ContentResolver cr, long idPhoto)
throws Exception {
return MediaStore.Images.Thumbnails.getThumbnail(cr, idPhoto,
MediaStore.Images.Thumbnails.MINI_KIND, options);
}