can I programmatically set screen to off in android if is not done automatically after 1 minute of inactivity.
is this possible to do programmatically in android?
I found this threads:
Android: How to turn screen on and off programmatically?
Turning screen on and off programmatically not working on some devices
but there is no timer after 1 minute.
Yes, the method best used in this case is to programmatically set screen timeout instead.
1000 is in milliseconds which means 1 second, you can replace it with any value as desired.
Needed permission:
UPDATE
It will overwrite the phone system value (Settings/Display/Sleep), so perhaps you need to restore the current settings after finish: