Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

Fixed exception when writing to cache with an uncached service #135

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
import android.app.Application;

import com.octo.android.robospice.persistence.CacheManager;
import com.octo.android.robospice.persistence.exception.CacheCreationException;
import com.octo.android.robospice.persistence.exception.CacheSavingException;

/***
* Concrete implementation of {@link SpiceService} with an empty CacheManager. Using this class,
* requests will not be cached.
* Concrete implementation of {@link SpiceService} with an empty CacheManager.
* Using this class, requests will not be cached.
*
* @author rciovati
*/
public class UncachedSpiceService extends SpiceService {

@Override
public CacheManager createCacheManager(Application application) {
// Just return an empty CacheManager
return new CacheManager();
}
return new CacheManager() {
@Override
public <T> T saveDataToCacheAndReturnData(T data, Object cacheKey)
throws CacheSavingException, CacheCreationException {

return data;
}
};
}
}