How to prevent automatic screen lock on android by code?
Jan 8, 2021
Just call this method and no need to get permission in the manifest file.
private void keepScreenOn() {
getWindow().
addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
Hope it helps you. ππ