How to delete internal storage file in android?

后端 未结 8 2049
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 06:27

I have used the Android internal storage to save a file for my application (using openFileOutput) but I would like to delete that file, is it possible and how?<

8条回答
  •  情歌与酒
    2020-11-30 07:02

    I know this is a bit of an oldie, but the docs say to use:

    deleteFile("filename");
    

    rather than:

    File.delete();
    

    Which if you are already using:

    getFilesDir();
    

    kind of makes sense.

提交回复
热议问题