Android唤醒锁问题
有人可以给我看一个使用两个按钮的示例代码片段吗?一个用于关闭屏幕,一个用于打开屏幕。我无法让它工作。谢谢!
Could someone please show me a sample code snippet where you use two buttons; one to turn off and one to turn on the screen. I cant get it to work. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不明白你的问题。您的应用程序中设置了唤醒锁,以便设备屏幕在特定时间段后不会关闭。建议您如何使用此
FLAG_KEEP_SCREEN_ON
标志,这是最好的方法强制屏幕打开
I don't understand your question properly. A wake lock is set in your application so that the device screen does not turn off after a particular span of time. how ever you are advised to use this
FLAG_KEEP_SCREEN_ON
flag and is the best wayForce Screen On
嗯,当屏幕关闭时,您希望如何显示按钮?除非你指的是硬件按钮,在这种情况下,我认为只有电源按钮可以重新打开屏幕。
Erm, when the screen is off, how are you hoping to display a button? Unless you mean hardware buttons, in which case I think only the power button can turn the screen back on.