I have an app that requires functionality to stay open while locking the screen in the background.
I have managed to get all that running, with the one problem that as soon as I call devicePolicyManger.lockNow();
the display goes black.
I have tried to acquire a wake lock using PowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "My Tag").aquire();
, but it seems that the call to lockNow()
overrides the wake lock.
Any tips?
Just after posting this, I realized that a very easy solution to the problem was to just wake the device again directly afterward. This solves the problem but causes the screen to go black briefly, which is not neat, so if anyone can come up with a better solution, please let me know.