展会距今$ P $时间pssing在Android中的一个按钮 [英] Show elapsed time since pressing a button in Android
本文介绍了展会距今$ P $时间pssing在Android中的一个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够以显示一个TextView或天文台自pressing位于另一个类中的按钮,在统计类举行的经过时间。什么是实现这个最简单的方法?
I want to be able to show the elapsed time in a textview or Chronometer held in a "Statistics" class since pressing a button located in another class. What would be the easiest way to implement this?.
感谢
推荐答案
有关设置什么变量= System.currentTimeMillis的()
当你膨胀的看法?
而在的onDestroy。减去那个时候从当前时间?
What about setting a variable = System.currentTimeMillis()
when you inflate the view?
And at onDestroy substract that time from the current time ?
这篇关于展会距今$ P $时间pssing在Android中的一个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文