mardi 4 août 2015

Cache Images with Volley

I'm trying to implement Image Caching into my app. The code i currently have regarding the images is below:

Network call to get images:

public void getImage(String url, final ImageView imageView) {

    System.out.println("Image Url is: " + url);
    ImageRequest requestImage = new ImageRequest(url, new Response.Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            imageView.setImageBitmap(response);
        }
    }, 0, 0, null, null);

    queue.add(requestImage);
}

How could I implement the caching? I have read a few articles on SO, but am not sure on how to implement it into my app?

Thanks for your help



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire