更新时间:2023-11-01 08:29:40
我通过创建和使用以下函数在后台缓存图像来解决该问题 在ImageLoader.java中
I solved it by caching the image in background by creating and using the following function in ImageLoader.java
public void cacheImage(String url){
Bitmap bmp = getBitmap(url);
memoryCache.put(url, bmp);
}
我创建了一个ImageLoader实例,对其进行了静态引用,然后调用
I created one instance of ImageLoader, made a static reference to it and then called
AsyncClass.imageLoader.cacheImage(url);
AsyncClass.imageLoader.cacheImage(url);
AsyncClass是我对ImageLoader进行静态引用并将其称为"imageLoader"的类.
Where AsyncClass is the class where I made the static reference to the ImageLoader and called it "imageLoader".