完成倒计时后,我想在文本视图中显示计数,例如:完成第一轮后文本视图应显示 x1,第二轮 x2
After finishing the countdown I want to show number of counts in a Text View ,eg: after finishing 1st round Text view should show x1, for 2nd round x2
[在此处输入图片描述][1]
强调文本
[1]: https://i.stack.imgur.com/tNgwZ.png
创建一个全局变量并在每次重置计时器时递增它
例子
int timerCounts = 0;
@Override
onCreate....
private void starttimer(){
......
.....
onFinish(){
timerCounts++;
your_text_view_to_show_counts.setText(timerCounts+'X');
}
}
[在此处输入图片描述][1]
强调文本 [1]: https://i.stack.imgur.com/tNgwZ.png
创建一个全局变量并在每次重置计时器时递增它
例子
int timerCounts = 0;
@Override
onCreate....
private void starttimer(){
......
.....
onFinish(){
timerCounts++;
your_text_view_to_show_counts.setText(timerCounts+'X');
}
}