当屏幕变暗时Android触摸事件(ish)?
我有一台三星 Galaxy Tab,它喜欢在大约半分钟后调暗设备上的灯光。当我触摸屏幕时,它会再次打开灯,但它还会将触摸事件发送到我触摸的任何视图,因此我最终单击了我不想单击的内容。
有什么方法可以知道屏幕已调暗灯光,因此触摸事件不应发送到视图?
更新: 我对每个活动都使用标志 keep_screen_on,但我真的不想这样做。自动调光会限制电池的使用,所以如果可能的话我想做点别的事情。
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 like to do something else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够从此处读取当前的亮度设置:
http: //developer.android.com/reference/android/provider/Settings.System.html#SCREEN_BRIGHTNESS
我发现这也很烦人,但我不知道是否应该由应用程序来修复它。
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.