How to listen for power off events in android, excluding restarts

824 Views Asked by At

I'm looking for a way to listen for a device being powered off in android, but I don't want to include device restarts. I found Intent.ACTION_SHUTDOWN which looked useful but that includes reboots, since the device is technically powered off then back on. Is there a way to take action when a device is powered off but not when it's restarted?

0

There are 0 best solutions below