Record Video to External SD Card on Android

点点圈 提交于 2019-12-04 17:56:41

Two things I can think of:

1: Your SD Card may not be mounted.

if (android.os.Environment.getExternalStorageState() != android.os.Environment.MEDIA_MOUNTED) then you have a problem.

2: All of the directories in path to the file may not exist.

filepath = getFilePath(locationName);
File file = new File(filepath);
File parentDir = file.getParentFile();
if (!parentDir.exists())
{
parentDir.mkdirs();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!