当我尝试写入外部存储空间时{EN}

时间:2015-09-12 21:31:24

标签: android filenotfoundexception android-external-storage saving-data

我尝试在外部存储空间上创建视频应用

 File pathToExternalStorage = Environment.getExternalStorageDirectory();
 //to this path add a new directory path and create new App dir (InstroList) in /documents Dir
 File appDirectory = new File(pathToExternalStorage.getAbsolutePath()  + "/documentst");
 appDirectory.mkdirs();
 mMuxer = new MediaMuxer(appDirectory.getAbsolutePath()+ "/video2.mp4", MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);

我收到此错误

Caused by: java.io.FileNotFoundException: /storage/1DEB-2B0B/documentst/video2.mp4: open failed: ENOENT (No such file or directory)

当我自己创建目录时,它会抛出权限被拒绝错误。 我已经添加了清单xml文件的权限,并且我确定已挂载sdcard。

我正在使用android studio和标准模拟器。

0 个答案:

没有答案
相关问题