dannyroa
dannyroa

Reputation: 5571

Preload & Cache Images then Delete Older Images from Cache

I'm building an Android app that displays a series of images.

I want to preload the images in the background and put them in the cache.

When a user sees an image, there is no need to continue caching the images since the user cannot go back to it so I want to remove them from the cache.

Can anybody point me to web sites related to this?

Thanks.

Upvotes: 1

Views: 3058

Answers (1)

AggelosK
AggelosK

Reputation: 4341

The best practices in Android Developers site has a solution for a similar situation. You can check it out here. The only problem is that they use an LRU cache that removes the least recently used image and not the most recently used as you want, however you can remove them manually (as a quick fix solution). Hope that helps.

Upvotes: 2

Related Questions