删除sd卡的文件

public static void deleteAllFile(){

String path = Environment.getExternalStorageDirectory().getAbsolutePath()+File.separator+"文件夹名称";

deleteFile(new File(path));

}

public static void deleteFile(File oldPath) {

if (oldPath.isDirectory()) {

File[] files = oldPath.listFiles();

for (File file : files) {

deleteFile(file);

file.delete();

}

}else{

oldPath.delete();

}

}

上一篇:How to Pronounce the Letters NG – No Hard G


下一篇:Django admin源码剖析