Skip to content Skip to sidebar Skip to footer

Volley Image Loader Concurrentmodificationexception

I am using volley image loader for loading image on my project from server. But in some cases i am getting the following error and application crashes. java.util.Concur

Solution 1:

You have to implement two ImageLoaders, one for the thumbnails and another one for the full-res images. Modify your RequestQueue singleton as follows:

//..private ImageLoader mImageLoader;
private ImageLoader mThumbLoader;
//...// Then in constructor
mThumbLoader = new ImageLoader(mRequestQueue, new ImageLoader.ImageCache() { ... });
mImageLoader = new ImageLoader(mRequestQueue, new ImageLoader.ImageCache() { ... });

// And then you build two gettersprotected ImageLoader getImageLoader() {
    return mImageLoader;
}

protected ImageLoader getThumbLoader() {
    return mThumbLoader;
}

If you invoke the mThumbLoader for the thumbnails and mImageLoader for the full res images it will work fine.

Post a Comment for "Volley Image Loader Concurrentmodificationexception"