I want android countdown timer that run every 5th mins, If current time is 02:33 then timer should run automatically at 02:35 for 5 mins and then stop and start again at 02:40.
here i want to pass Int T = next 5th min, if current min is 31 then i want 35.
private void Timer(int t){
Log.i("snake", String.valueOf(t));
new CountDownTimer(t*1000,1000) {
@Override
public void onTick(long millisUntilFinished) {
long second = (millisUntilFinished / 1000) % 60;
long minutes = (millisUntilFinished/(1000*60)) % 60;
timer.setText("Time Left - " + minutes + ":" + second);
}
@Override
public void onFinish() {
timer.setText("Finish");
// Timer();
}
}.start();
}