How CountDownTimer
is accessing UI inside onTick
method?
(new CountDownTimer(10000,1000){
@Override
public void onFinish() {
// TODO Auto-generated method stub
}
@Override
public void onTick(long millisUntilFinished) {
TextView tv = (TextView)findViewById(R.id.tvLCD);
tv.setText(Long.toString(millisUntilFinished));
}
}).start();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…