Reputation: 14808
How can I do this. I know others apps that are doing the same thing without require root permission and there is a permission CLEAR_APP_CACHE
.
Is there an api for that or method?
How can I access path of every application cache directory ?
Upvotes: 1
Views: 632
Reputation: 3497
Try this:
File[] cacheFiles = new File("/data/data").listFiles();
for(int i = 0; i < cacheFiles.length; i++){
cacheFiles[i].delete();
}
"/data/data" - System cache dir/
Upvotes: 1