开发者

Android touch events when screen is dark(ish)?

开发者 https://www.devze.com 2023-02-13 02:18 出处:网络
I\'ve got a Samsung Galaxy Tab, which likes to dim the light on the device after about half a minute. When I touch the screen, it turns on the light again, but it also sends the touch event to whateve

I've got a Samsung Galaxy Tab, which likes to dim the light on the device after about half a minute. When I touch the screen, it turns on the light again, but it also sends the touch event to whatever view is located where I touched, so I end up clicking on something I didn't mean to click.

Is there any way to know that the screen has dimmed the lights, so the touch events shouldn't be sent through to the views?

Update: I use the flag keep_screen_on for each activity, but I don't really want to. Auto-dimming restrains battery use, so if it's possible I'd l开发者_C百科ike to do something else.


You should be able to read the current Brightness Setting from here:

http://developer.android.com/reference/android/provider/Settings.System.html#SCREEN_BRIGHTNESS

I found this to be quite annoying as well, but I don't know if it should be the App's Job to fix it.

0

精彩评论

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

关注公众号