[英]folder created not found in external storage android studio device explorer
am trying to create a folder in the android emulator external storage我正在尝试在 android 模拟器外部存储中创建一个文件夹
using this code:使用此代码:
File sdIconStorageDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/rafik/");
sdIconStorageDir.mkdirs();
it worked well before but now I can't find the directory in the external storage of the android studio emulator using the device explorer, the sdIconStorageDir.mkdirs()
;它以前运行良好,但现在我无法使用设备资源管理器
sdIconStorageDir.mkdirs()
在 android studio 模拟器的外部存储中找到目录; return true
but the folder is missing, however, the folder is created successfully and it's visible when I use my physical phone so What is my problem?返回
true
但文件夹丢失,但是,文件夹已成功创建并且在我使用物理手机时可见,所以我的问题是什么?
Update the code like that.像这样更新代码。 And also give the permission for READ And WRITE External Storage in Manifest File.
并在清单文件中授予 READ 和 WRITE 外部存储的权限。
File file = new File(Environment.getExternalStorageDirectory()+"/FolderName");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.