简体   繁体   中英

Run service using Repeat alarm in between particular time of Day

I have a service which runs on every 1 minute using repeat alarm. But I want to run this service in between 9.30 AM to 4 PM and 8 PM - 2.30 AM (timezone is Indian Standard Time-IST) only and run for every 1 minutes.

For example :

    UTC Time
StartTime   EndTime
22:00   05:00
23:50   06:12
00:00   06:00
01:00   09:00
01:00   05:30
01:15   08:00
01:20   08:00
01:30   07:00
02:30   09:00
03:00   09:30
03:45   10:00
04:00   09:00
06:00   15:00
07:00   14:25
07:00   15:00
07:00   21:00
07:30   15:30
07:55   16:35
08:00   16:30
9:00    15:00
13:00   20:00
14:00   20:00
07:30   10:30

How to run a Service for every 1 min in between the above UTC timings only? Should I use a Service to run on 24 hours and inside the service check condition to do logic or can I manage using repeat alarm itself?

当您要停止警报时,使用与创建警报管理器相同的意图来取消您的alarmManager。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM