Question

I am starting to use robospice for an application which has to function in regions with changing connectivity.

How would I achieve that robospice would automatically return the cached data when the network is down?

Thanks Ben

Était-ce utile?

La solution

I have not worked with Robospice at all. But from what I can tell it looks like the request class allows you to specify AcceptingDirtyCache by calling

   request.setAcceptingDirtyCache(boolean isAcceptingDirtyCache) 

there was a thread about this on github that talks about this very problem.

Also not sure since I have never used robospice but you should be able to call CacheManager.loadDataFromCache() to load any data that exists in the cache. So you could utilize this function whenever you need to make a request but the network is down.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top