How do I start chronometer with a specific starting time?

For Kotlin,

To start Chronometer with starting time 20 seconds, you can use

val timeInMilSeconds = 20000
chronometer.base = SystemClock.elapsedRealtime() - timeInMilSeconds
chronometer.start()

This will start Chronometer with starting time 20 seconds i.e. 00:00:20


In general the chronometer works like this (if you would like to set the Base to a specific nr):

mChronometer.setBase(SystemClock.elapsedRealtime() - (nr_of_min * 60000 + nr_of_sec * 1000)))

so make it:

 mChronometer.setBase(SystemClock.elapsedRealtime() - (2* 60000 + 0 * 1000)))