Reputation: 26034
I have a Chronometer
and a int
variable representing the accumulated minutes when it was stoped. I want to resume the chronometer from these minutes.
int accumulatedMinutes = 2;
chronometer.setBase(SystemClock.elapsedRealtime() + accumulatedMinutes*60000);
But, in the case above, instead of 02:00
, I get 00:-120
Thanks.
Upvotes: 3
Views: 92
Reputation: 75788
Need Subtraction
instead of Addition
.
You should try with
chronometer.setBase(SystemClock.elapsedRealtime() - accumulatedMinutes*60000);
Upvotes: 2