robospice
robospice copied to clipboard
SpiceManager.removeAllDataFromCache() doesn't work
Version 1.4.12
I'm developing an app, that stores all messages in cache for 5 minutes:
getSpiceManager().execute(spiceRequestCheckingAccounts,
"ServiceCurrentAccountsList",
DEFAULT_CACHE_DURATION,
spiceListenerCheckingAccounts);
Where spiceRequestCheckingAccounts is GSON object.
At the startup of the application (new session), I call
getSpiceManager().removeAllDataFromCache()
but it doesn't remove the previous messages.
Does anyone have a similar issue? Is this a bug?
Is it the same instance of SpiceManager, or at least 2 instances related to the same service class ?
Question is marked as invalid as we need more details. If you had a test that fails, that would help too.
it is 2 different instances... each block of code i wrote before, are in different activities.
Unfortunately, I'm not able to provide a test...
After a lot of tries, I have managed to find a solution.
getSpiceManager().removeAllDataFromCache();
try {
FileUtils.cleanDirectory(getActivity().getCacheDir());
} catch (IOException e) {
Log.e(TAG, "Could not clean cache directory: " + e.getMessage());
}
Ofc,this erases all the app's cache. Is not the perfect solution.
Does it happen all the time (that it doesn't work) or under uncertain and hard to reproduce circomstances ?