Search This Blog

Saturday, November 23, 2013

Delete Directory with its all the inner file and Directories

This is the simple method to remove all the files and folders from the path in the SDcard.

void DeleteRecursive(File fileOrDirectory) {
if (fileOrDirectory.isDirectory())
for (File child : fileOrDirectory.listFiles())
DeleteRecursive(child);

fileOrDirectory.delete();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.