Skip to content

Commit

Permalink
Polish after latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoperini committed Apr 7, 2021
1 parent aa3060a commit 3b45e78
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,19 +547,18 @@ private void runOnUi(Runnable runnable) {
UiThreadUtil.runOnUiThread(runnable);
}

// For to Delete the directory inside list of files and inner Directory
// To delete all contents recursively, like rm -rf
private static boolean deleteDir(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i=0; i<children.length; i++) {
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}

// The directory is now empty so delete it
return dir.delete();
}
}

0 comments on commit 3b45e78

Please sign in to comment.