如何删除内部存储文件中的android? [英] How to delete internal storage file in android?

查看:89
本文介绍了如何删除内部存储文件中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了Android内部存储来保存文件,我的应用程序(使用 openFileOutput ),但我想删除该文件,这可能又如何?

解决方案

 文件DIR = getFilesDir();
档案文件=新的文件(目录,my_filename);
布尔删除= file.delete();
 

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?

解决方案

File dir = getFilesDir();
File file = new File(dir, "my_filename");
boolean deleted = file.delete();

这篇关于如何删除内部存储文件中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆