Lollipop Lollipop - 2 years ago 72
Android Question

How to make the alarm that sound at phone shutdown time in Android

I had made a reminder that I want it to sound when the phone at shutdown time.
I just konw that I set the

when I execute
AlarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent)
,but I had make a experiment , it not work.
Anyone solve it? Thank you!

Answer Source

As Tim Castelijns points out in the comments on the question, AlarmManager has nothing to do with the device shutting down.

You are certainly welcome to have a BroadcastRecevier registered for ACTION_SHUTDOWN. Since the device is shutting down, you may or may not be able to actually play a sound or otherwise notify the user at this point in time, but you are welcome to try.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download