I would like to clarify something about TimerTask. When you have the code below:
timer.schedule(task, 60000);
where the task is scheduled to run in the next 1 minute, is the task object already executing?
because somewhere in my code I called task.cancel() but it seems that the call doesn't prevent
task to be executed. I even logged the return value from the call and it returns false.
I came about my question when I read the documentation for the cancel method:
Cancels the TimerTask and removes it from the Timer's queue. Generally, it returns false if the call did not prevent a TimerTask from running at least once. Subsequent calls have no effect. Returns true if the call prevented a scheduled execution from taking place, false otherwise.
I believe I called cancel() before the 1 minute delay. But how come cancel returned false,
is it [task] already executing?
Hope you can give me clues/hints or even an explanation to this. Thanks SO!