Turn the screen in to totally dark when press the button on the screen

本秂侑毒 提交于 2019-12-25 02:46:44

问题


How to code the android to turn the screen completely off just like you press the power button to lock your screen.

I want the user to press the button on the screen and then screen goes off.

I have tried (with permission):

PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "tag");

wl.acquire();

but not working for me, please help! thank you!

来源:https://stackoverflow.com/questions/23432552/turn-the-screen-in-to-totally-dark-when-press-the-button-on-the-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!