Why to use getCacheDir() on Android

后端 未结 2 1184
自闭症患者
自闭症患者 2020-12-31 03:25

Android may auto-delete the files in CacheDir once the system gets low on memory. But the docs say we should not rely on the system clearing this cache, and hence write addi

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 03:32

    getCacheDir() returns the path to the cache files whereas getFilesDir() returns the path to files created and stored in the internal storage of your app. The internal storage is persistent: it cannot be deleted by the system.

提交回复
热议问题