Android Alarm What is the difference between four types of Alarm that AlarmManager provides and when to use what?

后端 未结 4 1381
我在风中等你
我在风中等你 2021-01-11 15:50

I want to know the difference between RTC, RTC_WAKEUP, ELAPSED_REALTIME, ELAPSED_REALTIME_WAKEUP.
I want to write an alarm application where I will set

4条回答
  •  猫巷女王i
    2021-01-11 16:32

    ELAPSED_REALTIME

    Alarm time in SystemClock.elapsedRealtime() (time since boot, including sleep). This alarm does not wake the device up; if it goes off while the device is asleep, it will not be delivered until the next time the device wakes up.

    ELAPSED_REALTIME_WAKEUP

    Alarm time in SystemClock.elapsedRealtime() (time since boot, including sleep), which will wake up the device when it goes off.

    RTC

    Alarm time in System.currentTimeMillis() (wall clock time in UTC). This alarm does not wake the device up; if it goes off while the device is asleep, it will not be delivered until the next time the device wakes up.

    RTC_WAKEUP

    Alarm time in System.currentTimeMillis() (wall clock time in UTC), which will wake up the device when it goes off.

提交回复
热议问题