Android Java : Turn screen Off
问题 I am making an application that turn the screen ON and OFF with the proximity sensor. The proximity code is finished, but i got trouble using the screen controls. I have read that I should use, PowerManager manager = (PowerManager) getSystemService(Context.POWER_SERVICE); manager.goToSleep(int amountOfTime); For that, I need to grant special permissions in order to make it works, but I haven't figured out how to do it. Also, I have read about changing screen brightness WindowManager