Java Timers - Functions called not completing!
- by Matt Swanson
So I have a TimerTask task calling a function onTimerComplete() in its run()
onTimerComplete() looks something like this:
private void onTimerComplete(){
myFunc1();
myFunc2();
}
I make a Timer t and I schedule the TimerTask with t.schedule(task, 2000);
The problem is, when the timer is up and the task runs my onTimerComplete() but that function does not finish. It runs myFunc1() but never finishes it nor does it ever call myFunc2()
However, if I call onTimerComplete() directly, everything works.
What's the deal here?