Commit abef2582 authored by jianglx's avatar jianglx

Merge branch 'master-video' of http://113.105.137.151:22280/lify/rvapp into dev_im

parents f8c27421 576e617f
...@@ -249,16 +249,20 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme ...@@ -249,16 +249,20 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> impleme
} }
String[] content = file.list();//取得当前目录下所有文件和文件夹 String[] content = file.list();//取得当前目录下所有文件和文件夹
if (content != null && content.length > 0) {
for (String name : content) { for (String name : content) {
File temp = new File(path, name); File temp = new File(path, name);
if (temp.isDirectory()) {//判断是否是目录 if (temp.isDirectory()) {//判断是否是目录
if (temp != null && temp.exists() && temp.getAbsolutePath() != null && !temp.getAbsolutePath().isEmpty()) {
deleteDir(temp.getAbsolutePath());//递归调用,删除目录里的内容 deleteDir(temp.getAbsolutePath());//递归调用,删除目录里的内容
temp.delete();//删除空目录 temp.delete();//删除空目录
}
} else { } else {
if (!temp.delete()) {//直接删除文件 if (!temp.delete()) {//直接删除文件
} }
} }
} }
}
return true; 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