public final int MSG_WHART=10;
private int count=10;
private TextView start,timer;
Handler handler=new Handler(){
@Override
public void handleMessage(Message msg) {
switch(msg.what){
case MSG_WHART:
if (count<0){
stopTimer();
}else {
timer.setText(count+"");
count--;
handler.sendEmptyMessageDelayed(MSG_WHART,1000);
}
break;
}
}
};