开发者

Is there an event to detect when the screen dims?

开发者 https://www.devze.com 2023-03-04 11:50 出处:网络
I\'m using a SCREEN_DIM_WAKE_LOCK and 开发者_如何学Pythonso my never turns off. It just goes from full brightness to dim.

I'm using a SCREEN_DIM_WAKE_LOCK and 开发者_如何学Pythonso my never turns off. It just goes from full brightness to dim.

Is there any way for me to detect when the screen gets dim (event, receiver, etc.) ?


As far as I can see from Android's source code, there is no broadcast notification send when screen brightness state is changed.


If you are using a WakeLock in order to make your screen dim. You can check if the WakeLock is aquired by using the .isHeld() method.


Get the screen Timeout and then take like -5 seconds

0

精彩评论

暂无评论...
验证码 换一张
取 消