Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 12
Registered: ‎06-01-2011
My Device: Blackberry Tourch
My Carrier: 3 mobile

Cascades way of keeping the display awake

Hi folks,


Does anyone know if there is a cascades way of keeping the display awake.  I am already aware of the flag SCREEN_IDLE_MODE_KEEP_AWAKE, however I am unsure how to use this since I don't have the handle to the screen window.


Any assistance appreciated.

Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Cascades way of keeping the display awake

Currently there is no Cascades-specific way to do this.

Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Cascades way of keeping the display awake

If it can't be done with Cascades yet, I think you could probably do it with a ForeignWindow that's a single pixel (if that's allowed), with z level set to put it above the plane of the Cascades (or with a one-pixel hole punched in the Cascades window to let it show through).

Set KEEP_AWAKE on that window and I would expect it to have the desired effect. If that works, you might even be able to make it transparent and in one corner, and no one will ever know it's there...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Posts: 62
Registered: ‎03-31-2012
My Device: Playbook
My Carrier: None

Re: Cascades way of keeping the display awake