I\'m using fedor\'s lazy loading list implementation in my test application where I can clear the cache with a single button click. How can I get the cache size of the loade
This has been more accurate to me:
private void initializeCache() {
long size = 0;
size += getDirSize(this.getCacheDir());
size += getDirSize(this.getExternalCacheDir());
}
public long getDirSize(File dir){
long size = 0;
for (File file : dir.listFiles()) {
if (file != null && file.isDirectory()) {
size += getDirSize(file);
} else if (file != null && file.isFile()) {
size += file.length();
}
}
return size;
}