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

Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified
Accepted Solution

Backlight always on

Is there a way to programatically keep the backlight always on?

I've tried this:

Backlight.enable(true, 86400); // a whole day

 but didn't work. I've tried to set first autodim off in the options and then run the app, but still it does not work.

A thread checking light and flashing periodically is not an acceptable solution for me.


I am testing on simulator (JDE 4.2.1) and real device (8310).


BlackBerry Development Advisor
Posts: 15,813
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Backlight always on

Look here:


How To - Enable the backlight and prevent the screen from turning off
Article Number: DB-00426


Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

Re: Backlight always on

[ Edited ]

Thanks for the link, Mark. I didn't know about the limitation of 255 seconds, I think it doesn't appear in the API reference.

But as I said, threads (or timers) are not a solution for my application. At least now I know there's no way of setting the backlight on with a single instruction.


EDIT: For those who may try the Timer approach (workaround?), note that the value "Backlight timeout" in the options menu has preference over your coded value in ms (at least this is what happens on simulators). The max timeout is 2 minutes (120 ms), so although the long param in Backlight.enable(boolean, long) can be as big as 255000, your timer must be called each 120000 ms or less.