这是我的应用程序,我想一些图片保存到我的SD卡。为此,我需要创建一个文件夹。
From my application, I want to store some images into my SD card. For that I need to create a one folder.
目前首次夹将创建,但它会检查该文件夹是否是present或不是之后。我该怎么办呢?
At the first time folder will create but after it checks whether that folder is present or not. How can I do it?
低于code将创建一个目录,如果它不存在
below code will create a directory if it does not exist
File direct = new File(Environment.getExternalStorageDirectory() + "/New Folder");
if(!direct.exists())
{
if(direct.mkdir())
{
//directory is created;
}
}