When you do not have permissions setup for external storage and you clear the cache of the application, then reload it and try and clear the cache onload using 'clear()'. It has a null value for 'files' variable and crashes. So I put this null pointer check in here just in case it is ever null again :)
FileCache.java
public void clear(){
File[] files=cacheDir.listFiles();
if (files != null)
{
for(File f:files)
f.delete();
}
}
When you do not have permissions setup for external storage and you clear the cache of the application, then reload it and try and clear the cache onload using 'clear()'. It has a null value for 'files' variable and crashes. So I put this null pointer check in here just in case it is ever null again :)
FileCache.java