@ R4j, you missed the point. Requests do not stop when the action holding the spicemanager terminates. In RS, requests will have their own life cycle and will be displayed in a different context (spice service, which is an Android service).
Thus, if you run a request, your activity dies or is killed, the spice request will go its own way, and the download will continue. An analysis will also occur, and finally your result will be cached. If there.
So, if you want to call a query in step A and get the result in step B, you must:
- just complete the query in step A, as usual, follow the RS patterns
in B, after running your spiceManager (i.e. right after super.onStart ()), do 2 things:
- use spiceManager.addListenerIfPending to replace a new action with any pending request
- use spiceManager.getDataFromCache to get any result that has already been cached using the previous query.
optionnally, if you want to re-execute the request in B itself, you can, and you will be happy to know that if you use the same request class with the same cache key, RS will aggregate your new request for any request that is waiting for you.
In RS, a request is identified by a composite key consisting of a "query result class" + a "query cache". This composite key can be used to retrieve the pending request, as well as any result set by this request in the cache.
Snicolas
source share