Java – Shows the elapsed time after pressing a button in Android

Shows the elapsed time after pressing a button in Android… here is a solution to the problem.

Shows the elapsed time after pressing a button in Android

I would like to be able to display the elapsed time since pressing a button in another class in a TextView or chronograph in the Statistics class. What is the easiest way to implement it?

Thanks

Solution

How about setting a variable = System.currentTimeMillis() when expanding the View?
On Destroy subtract that time from the current time?

Related Problems and Solutions