Android Volley ListView Images Not Loading When Using DiskBasedCache


Staff member
I have an app that loads images on each item on a list view, and I use Volley to make life easier for me; I need to have to images loaded from disk if it's already been downloaded before.

<strong>Problem:</strong> It won't work. It needs to re-download the images all over again. I need to have the image saved even after I exit the app.

<strong>Weird:</strong> It works only on one particular image (and it has nothing to do with size)!

<strong>What I Used:</strong> I patterned this using this site: <a href="" rel="nofollow"></a>.

I also tried this: <a href="" rel="nofollow"></a>

<strong>The Code:</strong>

String godzilla = "";

//String meme = "";
ImageCacheManager.getInstance().getImageLoader().get(godzilla, new ImageLoader.ImageListener() {
    public void onResponse(ImageLoader.ImageContainer imageContainer, boolean b) {
           viewHolder.backgroundImage = imageContainer.getBitmap();
           updateBackgroundImage(viewHolder,  viewHolder.backgroundImage, object);

    public void onErrorResponse(VolleyError volleyError) {

if(viewHolder.backgroundImage != null)
    updateBackgroundImage(viewHolder, viewHolder.backgroundImage, object);

I've tried the meme website, and it still has problems. I had one particular site that contains an image that oddly works. Which makes it even more confusing.

<strong>Edit:</strong> Additional info, it seems like there's an error on adding lruEntries as lruEntries.remove(entry.key is being called on completeEdit().