I got the following problem,
I have an unity Game which I would like to run. During running the Game, it always lowers screen lighting and switch of after about 2,5 minutes.
I already tried:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
and
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"MyWakelockTag");
wakeLock.acquire();
Links:
Android disable screen timeout while app is running
Programmatically disable screen timeout
But after this, it still switches off as before.
Were there any changes done, in android or are there any other solutions to solve my problem.
Thanks.