I have 2 timers for my GWT application. Both are repeating timers. I start running Timer1 and after some point, I cancel the timer inside its run() method and do scheduleReapeating for Timer2. Timer1's cancel occuts, but Timer2 doesn't not running. I tried running Timer2 directly and it did run. So there is nothing wrong with Timer2's code. Only that it is not running if I make it run from within Timer 1. Can't we not schedule timers whis way?
Timer timer1 = new Timer() {
@Override
public void run {
//Some processing
//...
//..
if(some_condition) {
cancel();
timer2.scheduleRepeating(100);
}
}
};
Timer2 timer 2 = new Timer() {
@Override
public void run() {
//some processing
//....
//....
}
};
}