my app does something when the screen goes black, but I want it to only carry out that task if the screen was turned off "by itself", through a screen timeout - NOT when the user presses the power-button. Is there any way to distinguish between these two events?
ACTION_SCREEN_OFF
obviously fires in both cases, and I haven't found any other intents that might match what I'm looking for.
Screen Timeout is an option on Samsung devices that will turn the screen off to save battery life. Out of the box the default is 30 seconds.
To get started, open the Settings app. From there, scroll down to Display. In the Display settings menu, look for the Screen Timeout option.
At the lower level there's an event happening when the screen times out, take a look with "adb logcat" and you'll see it, dig from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With