问题 whit getExternalFilesDir,在 DDMS 中找不到我的目录
Issue whit getExternalFilesDir, can't find my dir in DDMS
我写了下面的代码:
String check=Environment.getExternalStorageState();
if (check.equals(Environment.MEDIA_MOUNTED)){
Log.d("exito","exito");
}
File file= new File(context.getExternalFilesDir(null)+"/Terrible","otracosa");
file.mkdir();
Log.d("cosaboleano",Boolean.toString(file.exists()));
if (file.exists()) {
Log.d("cosa2", "tará!!!");
}
我将此权限添加到清单中:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
从日志中得到这个输出:
08-09 17:55:03.575 29236-29236/com.example.ruelas.downloadpractice D/exito: exito
08-09 17:55:03.578 29236-29236/com.example.ruelas.downloadpractice D/cosaboleano: true
08-09 17:55:03.578 29236-29236/com.example.ruelas.downloadpractice D/cosa2: tará!!!
并在 mnt/sdcard 中查找了我的文件,但那里什么也没有:
我在哪里可以找到据称创建的文件?我必须创建一个额外的虚拟 SD 卡吗?
emulated ->0 -> yo will find your all sdcard data there
我写了下面的代码:
String check=Environment.getExternalStorageState();
if (check.equals(Environment.MEDIA_MOUNTED)){
Log.d("exito","exito");
}
File file= new File(context.getExternalFilesDir(null)+"/Terrible","otracosa");
file.mkdir();
Log.d("cosaboleano",Boolean.toString(file.exists()));
if (file.exists()) {
Log.d("cosa2", "tará!!!");
}
我将此权限添加到清单中:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
从日志中得到这个输出:
08-09 17:55:03.575 29236-29236/com.example.ruelas.downloadpractice D/exito: exito
08-09 17:55:03.578 29236-29236/com.example.ruelas.downloadpractice D/cosaboleano: true
08-09 17:55:03.578 29236-29236/com.example.ruelas.downloadpractice D/cosa2: tará!!!
并在 mnt/sdcard 中查找了我的文件,但那里什么也没有:
我在哪里可以找到据称创建的文件?我必须创建一个额外的虚拟 SD 卡吗?
emulated ->0 -> yo will find your all sdcard data there