I'm trying to implement a very simple stopwatch widget in my Android activity such that the user can hit start/reset to start the timer, and stop to stop it. All of the functionality is there, but I can't seem to find a way to constantly display the value of this stopwatch.
I'm currently using a custom object that stores a long
value representing the time the Stopwatch
object was created, a constructor that sets this long
value to the current time, and a displayTime
method that returns the a double
value representing the current time in seconds by subtracting the current time from the original time and divides by 1000.0.
Like I said, functionally it's flawless, but I can't see a way to constantly update a TextView
object with the value of displayTime()
. Can anyone suggest as simple of a solution as possible to accomplish this? Thank you!