gwtgwt-activities

Recurring action when a user leaves a place


I want to schedule a recurring action in my Activity (I am using Activities and Places design pattern). When my user leaves a place associated with this activity, how quickly can I expect this action to stop? Will the inclusion of the recurring action somehow affect the way an Activity is disposed of?

I don't need an immediate guarantee. If an activity is disposed of normally, it's acceptable in my use case.


Solution

  • It is your responsibility to cancel anything that you started in your activity, if you need/want so.

    With a Scheduler.RepeatingCommand, you'd have to keep the command around and, in the activity's onStop, set a flag on it so that the next time it's run it exits early and returns false.