[TIMOB-2102] Android: Expose Keep Screen On
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-09-02T13:59:09.000+0000 |
Affected Version/s | Release 1.6.2 |
Fix Version/s | Sprint 2011-34, Release 1.8.0 |
Components | Android |
Labels | module_window, parity, qe-testadded |
Reporter | Don Thorp |
Assignee | Don Thorp |
Created | 2011-04-15T03:10:31.000+0000 |
Updated | 2012-02-08T15:25:19.000+0000 |
Description
Expose ability to keep the display from going to sleep.
+1 for this, would be a nice addition to 1.5.0
I've got some "info at a glance" apps which all pretty much rely on being able to glance and get info without having to constantly wake the device. Thanks again for adding the ticket Don.
setKeepScreenOn is the recommended method for GUI. WakeLock is needed for services. The following post is from an Android framework engineer: {quote} setKeepScreenOn() does prevent it from locking; it is just another way of setting the window flag to keep the screen on. PLEASE use these APIs instead of wake locks if keeping the screen on is associated with an activity or window. There are so many advantages: no need to get an additional permission, no chance you can accidentally cause the user's screen to stay on when they leave your app, no chance to have bugs like here where you crash, and just so much easier to do. Dianne Hackborn Android framework engineer hack...@android.com {quote}
Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120207171634 OSX Lion 10.7.3 Nexus S OS 2.3.6 Verified that I was able to keep the screen on using the sample code provided