Inspired by this example, I would like to delete a specific application's files (cache).
Here is the code:
void DeleteRecursive() {
String path="/sdcard/android/data/aaa.bb.cc/cache"
File fileOrDirectory= new File(path);
if (fileOrDirectory.isDirectory())
for (File child : fileOrDirectory.listFiles())
DeleteRecursive(child);
fileOrDirectory.delete();
}
But after deleting files when I go into the file manager, file still exists. What is wrong?