I am performing an activity that takes long time(offline). I am sending and receiving(reading) sms in my app for this i am using a count down timer class which has a listener onTick()
and onFinish()
. in the onTick()
listener i am checking if there is any new message and if there is any new message from the expected message it will stop the timer and display it on my screen. Everything seems to be okay. the problem arises when i leave and re-enter the app or change the orientation.
While working with network calls robospice
takes care of all these activity transition problems. So I want to solve the above issue using robospice
. I have seen the robospice
offline example in the github
. But there LoadDataFromNetwork()
doesn't handle any listeners. It just performs a prolonged task.
If I had correlated the offline example with my problem then what I have to do is just call the spiceManager.execute()
method inside my onTick()
listener and the loadDataFromNetwork()
will just read the message from my inbox and check if there is any message of desired kind and return that to the requestListeners
. But that's not what I want. I want robospice to moderate the complete timer class.
I couldn't get how to fire robospice
requestlisteners
only when I read the specific required message as the reading activity is performed in timer ontick()
Listener.
Is it actually possible with robospice to do like this ?? If not please give me a solution to deal with the actual problem mentioned in the first paragraph.