Is there a way to be notified when the user clears the app's cache?

My app stores a lot of data into the cache. If the user clears app's data the app is closed and all is ok; but if he just clears the app's cache the app continues to work... is there a way to be notified (for example with a broadcast receiver) when the user has cleared the cache?

At the moment I simply made it by putting a useless file into the cache dir, when the user clears the app's cache that file is deleted. When the app passes from the activity's onStart I check for that file and, if it is not present, I realize that the cache has been emptied.

Is there a smarter way for doing it?

链接地址: http://www.djcxy.com/p/60574.html

上一篇: ASP.NET缓存文件相关性清除会话

下一篇: 当用户清除应用程序的缓存时是否有通知的方式?