If I set a timer in the default Android clock app, then it has the following behavior when the time runs out:
- If the phone is unlocked, a pop-up comes up allowing you to stop the alarm or navigate back to the app.
- If the phone is locked (including if the screen is off), the screen turns on and you're taken to a special Activity to stop the alarm.
What is the best way to reproduce both of these behaviors in my own app? I've been copy-pasting various magical incantations involving AlarmManager
for the second, but nothing is working. None of the questions that have come up when Googling things like "bring Activity to front" or "wake up phone" seem to be what I need.