Let's say I have this variable:
long myMillis = 20000;
This means that I want my Chronometer to start at exactly 20 seconds (00:20).
I tried doing this:
chronometer.setBase(myMillis);
But it doesn't work. It dosn't start with 20 seconds. It starts with some weird time that doesn't make sense.
For Kotlin,
To start
Chronometer
with starting time 20 seconds, you can useThis will start Chronometer with starting time 20 seconds i.e.
00:00:20
Its Late but may help others. I have used following code in first fragment
and then move on some condition to next fragment where chornometer should start at same time of previous chornometer ends, i get elapsed time using this code.
and i send elapsedMilis in next fragment and use following code
it worked perfectly.
so make it: