Android : CountDownTimer not accurate

on Saturday, September 20, 2014


I have an Sndroid service running in the background. I want to be notified after a specific period of time (22 seconds), so I write:



private CountDownTimer mCountDownTimer = new CountDownTimer(22*1000,22*1000) {

public void onTick(long millisUntilFinished) {}

public void onFinish()
{
doSomething();
}
};


I run this, and get the notification after 40 seconds, and even 50 seconds. Am I doing something wrong? How can this be done?


0 comments:

Post a Comment