Description
ApplicationContext$ScheduledCallback extends TimerTask and queues a runnable on the UI thread when the timer task is called to run. This presents a threading problem: the timer task may be called to run (on the Timer thread) while the underlying runnable is running on the UI thread. In this case, the underlying runnable may call cancel() on the timer task, but since the timer task is currently running, the underlying runnable will be re-queued on the UI thread, meaning that it will get called to run after the timer task has been cancelled.