【发布时间】:2014-05-26 13:36:50
【问题描述】:
在我的代码中,使用此代码将内容写入文件
//the path
String fileName = Environment.getExternalStoragePublicDirectory(fileName) + File.separator+"Foo"+File.separator;
File dir = new File(fileName);
//the file
fileName += "bar"
File file = new File(fileName);
try {
file.createNewFile();
} catch (IOException e) {
//do nothing, for now
}
return;
这导致文件被写入/storage/emulated/0/ 而不是/storage/sdcard0。我遇到的问题是,当我将设备连接到我的机器(Ubuntu 13.10)时,我看不到/storage/emulated/0/。
【问题讨论】:
标签: android android-sdcard mount filewriter