Skip to content Skip to sidebar Skip to footer

Recyclerview Lazy Loading

I'm doing lazy loading on a RecyclerView adapter. First I fetch the image metadata (if it has any) and then let Picasso download the actual image. public class PostHolder extends R

Solution 1:

It's fixed now, though I'm not exactly sure why. I believe it's

Picasso
    .with(getContext())
    .cancelRequest(this);

inside unsetImage() because of the double request needed to load it.

What I think happens:

  1. Picasso is still loading the previous image.
  2. A call for the current image metadata is dispatched.
  3. Picasso loads the preVious image. Since Picasso doesn't know about the metadata, it's not automatically canceled.
  4. The metadata get's loaded, and Picasso starts loading the current image.

Post a Comment for "Recyclerview Lazy Loading"