¡@

Home 

2014/10/16 ¤W¤È 08:26:31

android Programming Glossary: timer2

Pausing/stopping and starting/resuming Java TimerTask continuously?

http://stackoverflow.com/questions/2098642/pausing-stopping-and-starting-resuming-java-timertask-continuously

inside the task of second timer. The class below shows exactly what I mean public class TimerTest Timer timer1 Timer timer2 volatile boolean a false public TimerTest timer1 new Timer timer2 new Timer public void runStart timer1.scheduleAtFixedRate.. I mean public class TimerTest Timer timer1 Timer timer2 volatile boolean a false public TimerTest timer1 new Timer timer2 new Timer public void runStart timer1.scheduleAtFixedRate new Task1 0 1000 class Task1 extends TimerTask public void run.. public void run System.out.println Checking a a SomeClass.getSomeStaticValue if a Pause stop timer1 start resume timer2 for 5 seconds timer2.schedule new Task2 5000 class Task2 extends TimerTask public void run System.out.println Checking..