0

I am using Picasso with recylerview. Picasso is populating the imageview from url as:

Picasso.get().url("url").center().fit().into(ivImageview)

However as I am scrolling up an down, I noticed that the image is blank then it shows the picture (meaning that It is downloading the image everytime).

Shouldn't Picasso be caching the image and reusing it? Is there something I need to enable? Thank you

Snake
  • 14,228
  • 27
  • 117
  • 250
  • I think this answer will be useful for you [Android Picasso cash images](https://stackoverflow.com/questions/30728511/android-picasso-cache-images) – Alireza Bideli Apr 24 '19 at 20:35

2 Answers2

0

Normally, picasso automatically caches the loaded images. You can check it by adding:

setIndicatorsEnabled(true);
setLoggingEnabled(true);

This will be showing where the image is loaded from. (Don't forget to remove it for the release app)

Please see: here

0

add this to your recyclerview

recyclerView.setHasFixedSize(true);
recyclerView.setItemViewCacheSize(20);
recyclerView.setDrawingCacheEnabled(true);
ismail alaoui
  • 5,748
  • 2
  • 21
  • 38