Android Question B4A - Force screen on?

PhilipK

Member
Licensed User
I've trawled a lot and can't find how to programatically turn on the screen when it is off.

The phone wake states appear to stop the screen going off when it's on but not be able to turn the screen on when it is off.

The Toggle library has toggle.useractivity which might work but I'm unclear on how to set the 'when' variable.:

upload_2015-4-21_12-38-41.png


Many thanks in advance.
 

PhilipK

Member
Licensed User
PhoneWakeState.KeepAlive should turn on the screen. Make sure to call it from a service.
It works, thanks Erel.

PhoneWakeState.KeepAlive does light up the screen when called from a service. Not forgetting to ReleaseKeepAlive later.
 
Top