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

Mar*_*arc 0 java 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)

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

Ted*_*opp 5

使用getFileStreamPath(FILENAME)找到你的文件.来自文档:

返回openFileOutput(String, int)存储创建文件的文件系统的绝对路径.