#android中不能创建文件夹,哪里都不能!
调试返回结果底下三个全是false
void createFile(File onClickFile, String fileName) {
File f = new File(onClickFile.getAbsolutePath(), fileName);
if (!f.exists()) {
try {
if (f.mkdirs()) { Toast.makeText(listActivity, "文件夹创建成功", Toast.LENGTH_SHORT).show();
//重新加载列表
clickItem(parentFile);
} else {
System.out.println("f.getAbsolutePath()---------" + f.getAbsolutePath());
System.out.println("f.canRead()-----------------" + f.canRead());
System.out.println("f.canWrite()----------------" + f.canWrite());
System.out.println("f.isDirectory()-------------" + f.isDirectory());
Toast.makeText(listActivity, "文件夹创建失败", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(listActivity, "文件夹创建失败", Toast.LENGTH_SHORT).show();
}
}
}