首页
\
问答
\
Android:在应用程序中清理缓存的活动生命周期方法是什么?(Android: What activity lifecycle method to clean cache in app?)
Android:在应用程序中清理缓存的活动生命周期方法是什么?(Android: What activity lifecycle method to clean cache in app?)
我将我的图像存储在缓存目录下的子目录中。 我有一个我想运行的缓存清理任务,它检查缓存的大小并在必要时删除文件(根据我设置的一些规则)。 我的问题是,运行此操作的最佳时间是什么? 我正在考虑其中一个Activity生命周期方法。 有什么建议么?
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?
原文:https://stackoverflow.com/questions/4514361
更新时间:2023-03-26 10:03