I'm on my way with implementing a caching mechanism for my Android application.
I use SoftReference
, like many examples I've found. The problem is, when I scroll up or down in my ListView
, the most of the images are already cleared. I can see in LogCat that my application is garbage collected everytime the application loads new images. That means that the most of the non-visible images in the ListView
are gone.
So, everytime I scroll back to an earlier position (where I really downloaded images before) I have to download the images once again - they're not cached.
I've also researched this topic. According to Mark Murphy in this article, it seems that there is (or was?) a bug with the SoftReference
. Some other results indicates the same thing (or the same result); SoftReference
s are getting cleared too early.
Is there any working solution?