Android新建文件夹
Android新建文件夹
private void openDir() {
File file = new File(file_Path);
if(!file.exists()){
if(file.mkdirs()) //makir()最多只能新建一层,makdirs()可以新建多层
Toast.makeText(getApplicationContext(),"新建成功",Toast.LENGTH_SHORT).show();
else Toast.makeText(getApplicationContext(),"新建失败",Toast.LENGTH_SHORT).show();
}
else Log.d(TAG,"文件夹已存在");
}
CAD加油!欢迎跟我一起讨论学习算法,QQ:1401650042