getExternalCacheDir() returns null after clearing data

前端 未结 3 1263
忘了有多久
忘了有多久 2021-02-07 04:45

I have a simple app that access and writes data to external storage. Everything works fine until I go to Settings -> Apps -> App Info and clear data via \"Clear data\" button, t

3条回答
  •  余生分开走
    2021-02-07 04:53

    getExternalCacheDir() returns cache dir like the name says. If there is no cache, there is no directory for it either. This directory is used for temporary files you removed with remove data command. In cases where phone is low on space, it can remove these folders itself too. Atleast some maintenance applications do so.

    getExternalFilesDir() returns the directory for space to save data.

提交回复
热议问题