I want the button to turn on and off the sleep mode in the application. I know how to turn it on:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); but how to turn off not sleep I can not
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); You can read about the flags in the documentation: https://developer.android.com/reference/android/view/Window.html#clearFlags(int)
Source: https://ru.stackoverflow.com/questions/527468/
All Articles