Im making an Alarm app, and using AlarmManager to set alarms. Im saving every alarm using Room after running the setAlarm on the AlarmManager, so I can later restore them if the phone gets turned off and o .
Im running a BroadcastReceiver after the device gets booted using the guide from Android Developer site: https://developer.android.com/training/scheduling/alarms#boot
And my idea is to get the alarms from Room on the onReceive method But Room uses a suspend fun to get the alarms, but I cant run it on the onReceive since BroadcastReceiver doesnt have a lifecycle
How could I achieve a similar result?
CoroutineScope
that you specifically set up for this sort of work. – Therapsid