Question

I'm looking for nice solution for measure time in Android activity, and how to show actual time in textBox.

My solution at this time is to get current time from system, then calculate how much time have elapsed and to show it at screen. This is possible (and when moving back to menu, save it to memory), but I don't know how can I give time to view when activity is on top.. I need a new thread to refresh textBox every second or sth like that?

And now I'm thinking, there must be gentler solution.. Any nice solution?

Was it helpful?

Solution

Use a Chronometer they are easy to use, its what your trying to do just already built into androids librarys

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top