[英]How to create a new folder when taking a photo from custom camera application?
Right now, I finished with my custom camera application that will save the picture that I took into sdcard. 现在,我完成了我的自定义相机应用程序,该应用程序会将我拍摄的照片保存到sdcard中。 But I want to put these pictures in a folder which will be create when you took your first photo. 但是我想将这些图片放在您拍摄第一张照片时创建的文件夹中。
Working step: Start my application > took a photo > check for the folder to stored in > if sdcard already have that folder then stored the photo inside the folder but if it doesn't have a folder then create new one > stop 工作步骤:启动我的应用程序>拍照>检查要存储的文件夹> sdcard是否已经有该文件夹,然后将照片存储在该文件夹中,但是如果它没有文件夹,则创建一个新文件夹>停止
something like this. 这样的事情。 Hope you understand what I mean, Thanks. 希望你明白我的意思,谢谢。
File mFile=new File("/sdcard/photos/newfolder");
mFile.mkdir();
Just before saving your file, simply create all the directory structure, the mkdirs method will do the necessary work if necessary. 在保存文件之前,只需创建所有目录结构,mkdirs方法将在必要时完成必要的工作。
new File("/sdcard/photos/newfolder").mkdirs() 新File(“ / sdcard / photos / newfolder”)。mkdirs()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.