I\'d like a simple mm:ss
timer to be displayed on my actionbar, be able to pick the number of minutes to start counting down from and then call a method once it\'s
Yes it's possible to add timer in toolbar action use this code in Java:
private void startTimer(long duration, long interval) {
CountDownTimer timer = new CountDownTimer(duration, interval) {
@Override
public void onFinish() {
//TODO Whatever's meant to happen when it finishes
}
@Override
public void onTick(long millisecondsLeft) {
int secondsLeft = (int) Math.round((millisecondsLeft / (double) 1000));
timerText.setText(secondsToString(secondsLeft));
}
};
timer.start();
}
and also use menu file defined timer id just like this
if learn more the visit youtube :)