According to RoboSpice documentation https://github.com/octo-online/robospice/wiki/Design-of-RoboSpice , i can use it in any Context.
Can't find an example of using Robospice in service context. I did some attempts but nothing happened, requests just not executes, no exceptions (Maybe some log leaking, what i need to do to enable robospice log on device?)
- Where to start/stop it? (spiceManager.start(this) / spiceManager.shouldStop())
- Where to create SpiceManager instance? (My service starts in application.onCreate() method, maybe i have to wait for some SpiceService initialization?)
some code
public abstract class SpicyService extends Service {
private SpiceManager spiceManager = new SpiceManager(SpiceService.class);
@Override
public void onCreate() {
super.onCreate();
spiceManager.start(this);
}
@Override
public void onDestroy() {
spiceManager.shouldStop();
super.onDestroy();
}
}