简体   繁体   English

完成倒计时后,我想在文本视图中显示计数,例如:完成第一轮后,文本视图应显示 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

[enter image description here][1] [在此处输入图片说明][1]

emphasized text [1]: https://i.stack.imgur.com/tNgwZ.png强调文字[1]: https : //i.stack.imgur.com/tNgwZ.png

Create a global var and increment that with every timer reset创建一个全局变量并在每次计时器重置时增加它

Example例子

int timerCounts = 0;

@Override
onCreate....


private void starttimer(){
  ......
  .....
  onFinish(){
    timerCounts++;
    your_text_view_to_show_counts.setText(timerCounts+'X');
  }

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想使用两个线程打印斐波那契数列。 比如第一个数字应该由第一个线程打印,然后第二个数字由第二个线程打印,依此类推 - I want to print the fibonacci series using two threads. Like 1st number should be printed by 1st thread and then 2nd number by 2nd thread and so on 在comboBox中显示对象的第一个和第二个值 - show the 1st and 2nd value of object in comboBox 如果我将提供第一栏的文字,我该如何获取第二栏的文字 - How can i get text of 2nd column if i will provide the text of 1st column 第1轮后,真假游戏无效 - True or false game doesn't work after 1st round 我如何获得从第一帧文本字段输入文本到第二帧文本的输出 - How I can get output from 1st frame textfield input text to 2nd frame textArea 每次迭代后停止第一个线程,以便第二个线程可以产生生成的随机数的阶乘 - halt the 1st thread after each iteration so the 2nd thread can produce the factorial of that generated Random number 比较两个文本文件,看看第二个文件中的单词在第一个文件中出现了多少次 - Compare two text files and see how many times the words in the 2nd file occurs in the 1st file 从第一个活动拨打电话后,第二个活动没有通话 - 2nd Activity doesn't call after calling from 1st Activity 在Runtime.exec()延迟一段时间后,如何将第二个命令附加到第一个命令? - How to append a 2nd command to the 1st one after some delay in Runtime.exec()? Java Web应用程序在第二次登录后销毁第一次登录会话 - java web application destroy 1st login session after 2nd login
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM