0

how can i do a count down that continue when i close the app, even when i turn off the phone. I tried to search in the internet but it doesn't work. Someone can help me? Thanks

This is the code of the count down that i want to contunue

new CountDownTimer(10000, 1000) {
    public void onTick(long millisUntilFinished) {
        tv1.setText("La cuenta llega a 0 en: " + millisUntilFinished / 1000);
    }
    public void onFinish() {
        tv1.setText("Listo!");
    }
}.start();
Zekirak
  • 191
  • 6
  • Can you elaborate your question as what is the purpose of this countdown? – Deepak Singh Oct 06 '16 at 01:34
  • even when the phone turned off??wow, it's some difficult task to do. the only thing that can do that is do your countdown on server side, when user open your apk, get the count down time from server – Randyka Yudhistira Oct 06 '16 at 01:37
  • Seems like it is not that much easy to achieve. But anyway I think that you will be able to do this using `AlarmManager`. Refer these links. [here](http://stackoverflow.com/questions/22223893/show-left-time-until-the-alarm-start) and [here](http://stackoverflow.com/questions/12512717/android-alarmmanager-after-reboot) – Kasun Dissanayake Oct 06 '16 at 02:11

0 Answers0