这是我试图在 android 的内部存储中创建文件的代码。它在模拟器中工作,我可以在 data/data/packagename/中看到该文件,但在真实设备中我找不到该文件。 更清楚地说,我在真实设备中找不到路径data/data/peckagename/,也没有看到任何文件名data.txt。我也想使用 eclipse 或任何其他应用程序导出它
File mydir = this.getDir("mydir", Context.MODE_PRIVATE); //Creating an internal dir;
File heapFile = new File(mydir, "data.txt");
FileWriter heapFileWritter = null;
String file="";
try{
if (!heapFile.exists()) {
heapFile.createNewFile();
}
file = heapFile.getAbsolutePath();
heapFileWritter = new FileWriter(file);
heapFileWritter.write(MyService.callcount);
最佳答案
您只能看到外部存储中的文件,您看不到设备内部存储中的文件,除非您为此安装了应用程序,
关于android - 无法在android中的真实设备的内部存储中找到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17828255/