Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以给我看一个使用两个按钮的示例代码片段吗?一个关闭,一个打开屏幕。我无法让它工作。谢谢!
我没有正确理解你的问题。在您的应用程序中设置了唤醒锁定,以便设备屏幕在特定时间跨度后不会关闭。如何建议您使用此FLAG_KEEP_SCREEN_ON标志,这是最好的方法
FLAG_KEEP_SCREEN_ON
强制屏幕开启
呃,当屏幕关闭时,你希望如何显示一个按钮?除非您指的是硬件按钮,否则我认为只有电源按钮才能重新打开屏幕。