我目前有一个简单的代码,其中将CSV文件保存在一个文件夹中,根据我的android studio监视器显示,我已成功将该文件保存在一个我无法访问的文件夹中,即“ / storage / emulated / 0 / Download / myfolder /552.csv”。
File path =new
File(Environment.getExternalStoragePublicDirectory(Environment. +
DIRECTORY_DOWNLOADS),"myfolder");
System.out.println(path);
if (!path.exists()){
path.mkdir();
}
File mypath=new File(path,(editSesion.getText().toString()+".csv"));
FileWriter mFile = new FileWriter(mypath,true);
CSVWriter writer = new CSVWriter(new FileWriter(mypath));
System.out.println(mypath);
有什么方法可以获取更常见的可访问文件夹的路径?
最佳答案
/ storage / emulated / 0 / Download /是手机存储的“下载”文件夹。
您期望有多少通用目录?