Home Clear cache of list of apps
Reply: 0

Clear cache of list of apps

user608
1#
user608 Published in May 27, 2018, 3:32 am

I am trying to make an app which clears cache of multiple apps. I know the cache of the current app can be cleared and it is pretty straight forward using the code below

public void clearCache() {
Log.i(TAG, "Clearing Cache.");
File[] dir = mContext.getCacheDir().listFiles();
if(dir != null){
    for (File f : dir){
        f.delete();
    }
   }
}

but i cannot find any post which shows or even mentions the task that i want to accomplish so all i want to know is whether i can clear the cache of another app using its package name.

Thank you.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.67968 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO