Search code examples
androidandroid-recyclerviewimageviewpicasso

Understanding picasso & recycler view


I am trying to understand how picasso behaves with recyclerview with ImageViews.

Is it possible when reusing ViewHolder picasso load old image. I mean: mPicasso.load(url1).into(imageView); mPicasso.load(url2).into(imageView); Which image will be loaded url or url2?

How can I cancel image loading process? I mean

mPicasso.load(url1).into(imageView); // Start image loading
..
// Image loading not finished, but
// ViewHolder detaches
// Should I remove any pending image loadings here or picasso will do it automatically?

Thanks in advance!


Solution

  • Well Picasso is good libarary and handles much of the programming headache itself. I have not used Picasso , as I really enjoy working with glide.

    I think picasso will be handling its cancel operation once the view is recycled. If not so then you can easily do it with one of the procedure discussed here.Please try this and let me know if this works for you