According to the Android documentation, this is not possible with an API level below 24. Chronometer only use counting. If you need to do this, go to CountDownTimer .
Example:
final int oneSecond = 1000;
final int tenSeconds = 100000;
CountDownTimer cTimer = new CountDownTimer(100000, oneSecond) {
public void onTick(long millisUntilFinished) {
int totalTime = 60000;
String v = String.format("%02d", millisUntilFinished/totalTime);
int va = (int)( (millisUntilFinished%totalTime)/oneSecond);
textView.setText("remaining seconds: " +v+":"+String.format("%02d",va));
}
public void onFinish() {
textView.setText("done!");
}
};
cTimer.start();
EDIT:
If you want to go with a GitHub solution, check out this and this
source
share