Skip to content

Using Pause Duration

Mark Taylor edited this page Jan 4, 2014 · 1 revision

The Background Service logic allows for it to be paused. Pause overrides the timer logic and disables any [doWork] (doWork) logic until such point at the pause duration has expired.

To use pause:

  • call setPauseDuration(long pauseDuration) - the pause duration, in seconds, will be added to the current date & time. Until such point as the time has expired the [doWork] (doWork) will not operate.
  • Override [onPause] (onPause) if you want to provide any specific logic when the background service is paused.
  • Override [onPauseComplete] (onPauseComplete) if you want to provide any specific logic when the background service pause duration has expired.

Note that this pause logic is not related to the Android pause logic.

Clone this wiki locally