小编Mar*_*arc的帖子

在Android中编写文件时我的目录是什么?

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_WORLD_READABLE);
fos.write(string.getBytes());
fos.close();
Run Code Online (Sandbox Code Playgroud)

当试图删除其中一个文件时,这就是我使用的,但它返回false.

String tag = v.getTag().toString();
File file = new File(System.getProperty("user.dir")+"/"+tag);
String s = new Boolean (file.exists()).toString();
Toast.makeText(getApplicationContext(), s, 1500).show();
file.delete();
Run Code Online (Sandbox Code Playgroud)

我怎样才能克服这个问题?

java android

0
推荐指数
1
解决办法
5304
查看次数

标签 统计

android ×1

java ×1