title: Android: What activity lifecycle method to clean cache in app?
body: <p>I'm storing my images in subdirectories under the cache directory. I have a cache cleaning task I want to run, that checks the size of the cache and deletes files if necessary (according to some rules I've set up). My question is, what's the best time to run this? I was thinking in one of the Activity lifecycle methods. Any suggestions?</p>