1.如果sd卡存在
File destDir = new File("/sdcard/hhaudio");
if (!destDir.exists()) {
try {
boolean bb = destDir.mkdirs();//bb为true 说明创建成功
boolean vb =bb;
} catch (Exception e) {
String ss = e.toString();
}
}
2.如果sd卡不存在
File destDir = new File("/data/data/hhaudio");
if (!destDir.exists()) {
try {
boolean bb = destDir.mkdirs();//bb总是false 创建失败
boolean vb =bb;
} catch (Exception e) {
String ss = e.toString();
}
}
对于sd卡不存在的情况非常迷惑,如何才能创建文件夹和文件,请各位大侠指点【真对真机而非模拟器】