How to delete folder(contain some folder and file) from internal storage? Folder have some below tree.
folder
|_________ C2 (folder)
|________1 (fo
Let me tell you first thing you cannot delete the Rootfolder because it is a system folder. As you delete it manually on phone it will delete the contents of that folder, but not the Root folder. You can delete its contents by using the method below:
private void DeleteRecursive(File fileOrDirectory) {
if (fileOrDirectory.isDirectory())
for (File child : fileOrDirectory.listFiles())
{
child.delete();
DeleteRecursive(child);
}
fileOrDirectory.delete();
}