How to delete internal storage file in android?

后端 未结 8 2073
爱一瞬间的悲伤
爱一瞬间的悲伤 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 06:47

    Another alternative in Kotlin

    val file: File = context.getFileStreamPath("file_name")
    val deleted: Boolean = file.delete()
    

提交回复
热议问题