Does anyone know how to disable ActiveAndroid default behavior of caching object models in LruCache?
I want to disable entirely from my project. I have been able to clear the cache manually using Cache.clear(); but I need to keep doing it every time I need to clear it. I just want to disable all together via configuration.
I couldn't find any documentation on this matter so I dug into the code and end up doing the below workaround.
It seems there is no way to disable caching in ActiveAndroid but they offer a way to set the maxSize of the LruCache via the Configuration class. So I initialized ActiveAndroid like this:
Configuration config = new Configuration.Builder(this).setCacheSize(1).create();
ActiveAndroid.initialize(config);
Setting the CacheSize to 1 sort of prevents the addition of Model objects to the cache so it seems to works fine.