How to save scheduled alarm after app was killed by Android or task killer?

Code that schedules alarm.

    PendingIntent sender = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
    am.set(AlarmManager.RTC_WAKEUP, time, sender);

Its working fine, but when I kill my app in task killer, I lost my scheduleed alarm. How to solve this problem?

22
задан Divers 28 August 2017 в 08:42
поделиться