尝试在java.util.concurrent.RejectedExecutionException
中加载图像时遇到ImageView
异常。这不是每次都发生,而是在某个时间发生。我知道为什么会发生此问题,但不知道如何处理
public void onPostExecute(HttpResource[] httpResources) {
if (httpResources != null) {
String imageUrl = httpResources[0].getUrl();
File imageFile = httpResources[0].getFile();
int count = 0;
ArrayList<ImageItem> list = map.get(imageUrl);
if (list != null) {
//TODO implement pagination or manage concurrent threads
for (ImageItem imageItem : list) {
ImageHelper.loadImage(context, imageItem.getImageView(), imageFile, imageItem.isAutoResize(), imageItem.isAutoOrientation(), CROP_LAYOUTS_PARAMS);
}
}
map.remove(imageUrl);
if (map.isEmpty()) {
LogHelper.i(LibConst.TAG, "HttpImageProvider cache is empty");
}
}
}
}