05-24-2012 03:40 AM
I was hope someone can help... All replies appreciated and Thank you in Advance...
I am facing the following problem, I have the a timertasker that I use inside a screen, that changes the UI when a certian period has passed (each 1sec=change countdown that I display for the user And each 10sec=I delete a manager and add another...)
However after a while of playing/using the application I can notice that the countdown starts goin down so fast, i think this means that scheduleAtFixedRate has change to lower value, and the call is not set any more at "timertask.scheduleAtFixedRate(ttt, 100, 100);" which was the original value set for it.
------------This is the Code-------------
private TimerTask tt;
public final static Timer ts1=new Timer();
------------inside my screen I run this code---------
new TimerTask() {
public void run() {
counter++;
if(SecondPassed)
SecondPassed=false;
else if(counter==10){
counter=0;
SecondPassed=true;
}
//some code works
//on if(SecondPassed is true)
}
};
ts1.scheduleAtFixedRate(ttt, 100, 100);
05-24-2012 05:06 AM