Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WorkManager API for Exact time execution [duplicate]

I want to send offline notification to user periodically at exact time (assume daily 9:00 AM). Right now I was trying workmanager Api but not able to find any method like AlarmsManager's setExact or setexactandallowwhileidle.

Only repeatInterval option is there that will be 24 (daily) in my case but how to send notification at exact time (9 : 00 am) .

like image 810
Ayush Jain Avatar asked Jun 20 '18 10:06

Ayush Jain


1 Answers

WorkManager isn't a replacement for AlarmManager. For your use case, AlarmManager sounds like the right solution. WorkManager is for deferrable tasks, not for executation of tasks at an exact time or while the system is in a low-power, idle mode such as doze mode.

like image 123
Steve Miskovetz Avatar answered Oct 11 '22 04:10

Steve Miskovetz