Start activity even when screen is turned off
I'm trying to start an activity with an alarm. The PendingIntent starts a receiver and the receiver starts the activity. My current issue is that the activity starts in the background and it's impossible to hear the alarm sound. Most of the flags from older SO questions are deprecated for Oreo and newer devices. Does anyone have a good approach how to handle this? Thank you in advance Alarm creation: alarmManager.setExact(AlarmManager.RTC_WAKEUP, intervalFinished, pendingIntent) Receiver class OnAlarmReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) {