4

I would like to know if it is possible to use RoboSpice in a BroadcastReceiver and, if it is, how should I handle the lifecycle ?

Right now I am just calling spiceManager.start(context) in the onReceive(Context, Intent) method, but the service in never stop.

Gaëtan

Gaëtan
  • 11,912
  • 7
  • 35
  • 45

1 Answers1

1

Without knowing more, I would say the best option is to call the SpiceManager's shouldStop method at the end of your processing in onReceive, or when the request listener is triggered.

Snicolas
  • 37,840
  • 15
  • 114
  • 173
  • The BroadcastReceiver is used for the widget in my application, and RoboSpice is used to get the new values to display on the widget. If you need more information, feel free to ask. For the moment, I did what you suggested: call `shouldStop()` at the end of `onReceive()`. Thanks. – Gaëtan Apr 30 '14 at 08:04
  • If that worked, then it's fine. Maybe you could accept the answer though :) – Snicolas Apr 30 '14 at 08:50
  • I was waiting for your answer before accepting it ;-) – Gaëtan Apr 30 '14 at 09:00
  • I don't get a response callback in the listener when I do call shouldStop() in the end of the onRelease() method. So I didn't add it. – stoefln Oct 28 '14 at 18:24