04-24-2013 06:20 PM
The screen turns off after a short time, as configured in settings. But sometimes, this should be disabled by software, e.g. the navigation software should not let the display get black. (BlackBerry Maps seems to manage this...)
There are other situations, where it could be a good idea to let the display in active mode, maybe for media players (watching video) and so on.
The settings page of the device even informs me in Security/Device Password about the fact, that applications could enlarge the time until the device will be locked with this password.
But I cannot find any documentation how both of this can be done from code.
What permission is needed and what do I have to call?
Solved! Go to Solution.
04-24-2013 06:22 PM - edited 04-24-2013 06:23 PM
This code will prevent the screen from locking:
#include <bb/cascades/Window> ... Application::instance()->mainWindow()->setScreenId
04-24-2013 06:27 PM
Yes, until turned off using the same command with a different parameter.
This can also be done from QML or using C API. This thread has more info:
01-06-2014 06:08 AM
It works fine.
I have put that line in my app's main .cpp