this code clear all cache apps before kitkat
any solution for delete cache on kitkat?
any solution for delete cache on kitkat?
B4X:
PackageManager pm = BA.applicationContext.getPackageManager();
// Get all methods on the PackageManager
Method[] methods = pm.getClass().getDeclaredMethods();
for (Method m : methods) {
if (m.getName().equals("freeStorage")) {
// Found the method I want to use
try {
long desiredFreeStorage = 100 * 1024 * 1024 * 1024; // Request for 100GB of free space
m.invoke(pm, desiredFreeStorage , null);
} catch (Exception e) {
BA.Log(e.getMessage());
// Method invocation failed. Could be a permission problem
}
break;
}
}