Welcome!

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

Java Development

Reply
Highlighted
Trusted Contributor
Posts: 130
Registered: ‎08-10-2010
My Device: Not Specified

cannot keep screen backlight on programmatically

Hi,

 

I'm trying to keep the screen backlight on while some background thread running.

 

I've tried the code recommended by KB knowlodge, but still doesn't work.

 

if(( Display.getProperties() & Display.DISPLAY_PROPERTY_REQUIRES_BACKLIGHT) != 0 )
        {
            Backlight.enable(true, 3600);
        }

 

 

Shouldn't it keep the light on for an hour?

Developer
Posts: 57
Registered: ‎05-04-2009
My Device: 9550
My Carrier: Verizon

Re: cannot keep screen backlight on programmatically

The maximum value for seconds is 255, and anything over that gets reduced to 255.

You'll have to make a timer and repeat that .enable(true, 255) until your hour is up.

Frank

Trusted Contributor
Posts: 130
Registered: ‎08-10-2010
My Device: Not Specified

Re: cannot keep screen backlight on programmatically

Thanks a lot. I'll try that.