1.创建文件
//文件根目录
String root =Environment.getExternalStorageDirectory().toString()+”/abc/”;
(1)创建文件夹
File videoFile = new File(videoPath);
if (!videoFile.exists()){
videoFile.mkdirs();
}
(2)创建文件
File vf1 = new File(videoFile,”video1.mp4”);
if (!vf1.exists()){
try {
vf1.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
android 文件操作
最新推荐文章于 2023-04-17 11:28:30 发布