Commit 576e617f authored by linfeng's avatar linfeng

bug修改

parent cbddaf15
......@@ -232,16 +232,20 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
}
String[] content = file.list();//取得当前目录下所有文件和文件夹
if (content != null && content.length > 0) {
for (String name : content) {
File temp = new File(path, name);
if (temp.isDirectory()) {//判断是否是目录
if (temp != null && temp.exists() && temp.getAbsolutePath() != null && !temp.getAbsolutePath().isEmpty()) {
deleteDir(temp.getAbsolutePath());//递归调用,删除目录里的内容
temp.delete();//删除空目录
}
} else {
if (!temp.delete()) {//直接删除文件
}
}
}
}
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment