AlarmManager delete all schedules on power-off?

前端 未结 3 515
無奈伤痛
無奈伤痛 2021-01-06 14:16

I have set an alarm at specific time. If the phone is turn off the alarm is lost? I have turn off the phone, start it again but the alarm did not trigger at the specified ti

3条回答
  •  猫巷女王i
    2021-01-06 14:30

    You could do it like this:

    Store the time in a SharedPreference, catch Intent.ACTION_BOOT_COMPLETED and set the AlarmManager again if required.

提交回复
热议问题