Closed jagg18 closed 10 years ago
Please check the following StackOverflow answer from the creator of RoboSpice: http://stackoverflow.com/a/24181943/754439:
addListenerIfPending will not trigger any request by itself, it only allows to plug a listener to an already pending request if such a request exists.
The addListenerIfPending() method is exactly what you need.
Also, please note that the preferred way of posting questions is https://groups.google.com/forum/#!forum/robospice.
I am executing a SpiceRequest from my activity. It uses publishProgress() to update a progress bar in my UI. However, when a user presses the Home button, or opens a new activity, onStop() is called and hence, spiceManager.shouldStop() is also called and listeners are detached. I do understand this is needed to prevent memory leaks.
Now when I go back to the app/activity, my progress bar does not get updated anymore even if my request is still running. Is there a way to re-attach a listener to this request? I cannot use addListenerIfPending() since the request is already running and re-executing the request is not an option. Can you point me to the right direction? TIA.