Looking at the getExternalCacheDir() documentation:
The platform does not always monitor the space available in external storage, and thus may not automatically delete these files. Currently the only time files here will be deleted by the platform is when running on JELLY_BEAN_MR1
or later and Environment.isExternalStorageEmulated()
returns true. Note that you should be managing the maximum space you will use for these anyway, just like with getCacheDir()
.
Looks like the device has to be Android 4.2 and later for the external storage caching. You could have your app do its own clean up. See here for detecting when your app is about to be uninstalled.