Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Potential problems with skipMemoryCache() in Picasso?

I have a main DashboardActivity that uses a REST client to grab photos from a staging server. I found that when I would load the Bitmap from the server into an ImageButton it would throw a OutOfMemoryError. I solved this issue with using .skipMemoryCache() like so:

Picasso.with(this)
       .load(imageUrl)
       .skipMemoryCache()
       .into(imageButton);

What would be some potential problems I would run into with this approach?

like image 524
AndyRoid Avatar asked Jan 24 '26 19:01

AndyRoid


1 Answers

You should not use skipMemoryCache now, because it is deprecated. Here is some discussion about this method. Instead of using skipMemoryCache you should use memoryPolicy(MemoryPolicy policy, MemoryPolicy... additional).

like image 105
PetrS Avatar answered Jan 26 '26 09:01

PetrS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!