Use alarmManager and service to perform schedule notification only during specific time period

前端 未结 1 1394
走了就别回头了
走了就别回头了 2020-12-09 05:18

I\'m building an app that will trigger notifications at specific time-intervals during the users waking hours.

I have an alarmManager running inside of a service. T

相关标签:
1条回答
  • 2020-12-09 06:11

    I was thinking to rework this code so that the alarmManager is fired at waketime and stopped at sleepTime, all while inside the service is a Timer that fires the notification method at specific intervals? Is there a better way to go about doing this?

    To my mind, forget thinking of a 'better' way, it seems the only way. Using a timer to control (enable/disable) another timer isn't so strange and makes complete sense to me.

    0 讨论(0)
提交回复
热议问题