0

I am writing to a file in my application. I want to find the file to check that the file has been written correctly (and so I can access the file via a web view). Here is the code I am using to write the file:

try {
    FileOutputStream fos = openFileOutput("rules.txt", Context.MODE_PRIVATE);
    fos.write(content.getBytes());
    fos.close();
} 
catch (Exception e) {
    e.printStackTrace();
}

and then I use this to get the directory of the file:

getFilesDir()

However the string it provides is not available as a directory on the my device (hidden files are shown).

Any help would be appreciated!

4

1 回答 1

2

Android 将您的内部文件写入/data/data/<your package name>/files/<filename>. 除非您是 root,否则您无法通过文件浏览器或其他方式访问它。

于 2013-02-19T22:11:26.020 回答