I have a countdowntimer that gets a long value of 86400000 (24 hours) in my android 5.1 emulator it recognizes 24 hours and starts counting since then but in other emulators and in my physical phone it does not start in 24 hours, it starts at 20, 18 hours, varies device time. I do not understand.
Code of my countdowntimer
private void contagemregressiva(final long temporestante) {
Log.d(TAG,"tempo restante recebido na contagem: " + temporestante);
new CountDownTimer(temporestante, 1000) {
public void onTick(long millisUntilFinished) {
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
Date date = new Date(millisUntilFinished);
txv_temporestante.setText(dateFormat.format(date));
temporestanteaa = millisUntilFinished;
}
public void onFinish() {
dados.setDia(dados.getDia()+1);
dados.setContagemVirou(true);
atualizarUI();
}
}.start();
}