通过触摸而不是电源按钮激活 Android
我们有一个平板电脑应用程序,我们希望在一段时间后对其进行屏幕超时,但希望用户通过触摸屏幕而不是设备侧面的“电源”按钮来重新启用它。
对此的最佳方法(电池性能)是什么?
- 使用部分唤醒锁定(屏幕会做出反应吗?)
- 以某种方式禁用屏幕,但保持一切(包括触摸响应)正常工作?
- 其他?
对此有何建议?
We've got a tablet application for which we want to screen to timeout after a certain period, but would like the user to re-enable it by touching the screen instead of the 'power'-button on the side of the device.
What's the best approach (battery performance) to this?
- Using a Partial Wake Lock (will the screen react?)
- Disable the screen in some way, but keep everything (including touch response) working?
- Other?
Any suggestions on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
加布里埃尔,
由于完全关闭屏幕是不可能的,因此您可能只想使用唤醒锁并将屏幕调暗至最低设置作为“超时”。这样您仍然可以接受屏幕触摸事件并将其从该状态“唤醒”并恢复到之前的亮度。
Gabriel,
Since this isn't possible by completely turning the screen off, you may want to just want to use a wake lock and dim the screen to its lowest setting as your 'timeout'. This way you can still accept screen touch events and 'wake' it from this state and bring it back to its previous brightness.