An instance of CountDownTimer must be created in the user interface thread.
If you have a custom class object:
public class MyTimer extends CountDownTimer{
public MyTimer(...){
super(duration,interval);
}
}
The design of the object must be performed in the user interface thread.
MyTimer mTimer = new MyTimer(...);
If multiple threads create and destroy a timer, make sure it is created in the user interface thread by doing something like this:
MyActivity.runOnUiThread( new Runnable(){
public void run(){
mTimer = new MyTimer(...);
}
});
, mTimer