Search This Blog

Showing posts with label isDirectory. Show all posts
Showing posts with label isDirectory. Show all posts

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();
}