11-24-2009 05:07 PM
Hmm, here's a problem, perhaps a bug? Javascript setTimeout() and setInterval() aren't working after the backlight times out.
DETAILS: I have a web page with a clock in the title bar. The time is updated with a javascript setInterval. As long as the page remains visable after loading it works great; the time updates. But once the backlight timeout occurs, after 35 seconds, the interval timer quits firing.
That is, if the tile clock said "1:02:03" as the screen goes dim, if I wake it up after five minutes, it will have frozen at "1:02:38".
(Probably not relevant but who knows: The duration of 35 seconds seems pretty repeatable. Also, if I wake up the screen before 35 seconds, it keeps going just fine. Dim, 34sec, wakeup, ok. Oddly, even though it says the clock stopped after 35sec, if I wake it up after 44 sec, it works fine. If I wake it up after 46 sec, it says the clocked stopped 10 sec ago at :35.)
(I also tried it using setTimeout() and manually setting the next timer. No difference, still fails to fire after a while.)
This is on a 9700 with OS 5.0.0.330, using the Internet Browser.
QUESTION: Does anyone know a way to keep setInterval firing even after the backlight's gone off???
Thanks.
11-29-2009 09:27 AM
Hi There,
I believe the browser has a timeout of "X" seconds where if the Browser is no longer the foreground application (or the device goes into sleep mode) that JavaScript will stop executing until the Browser becomes the foreground application again.
Does your interval or timeout start working again in their loop and pick-up where they left off after the device comes back on?
02-04-2010 04:12 PM
I am having the same problem. Trying to issue a page refresh and force the user to re-authenticate, but the Curve 8900 goes to sleep and script stops working. Any help will be greatly appreciated.
03-03-2010 03:37 PM
I have the same issue. I have a setInterval object that sends an ajax request for updated information in a public feed. However it quits as soon as the backlight is turned off and the blackberry goes into sleep or stand by mode.
I know of a few possible workarounds:
-Changing the settings on the BlackBerry so the backlight never turns off ... (not so good on battery life)
-Providing the user with a refresh button if they notice the information not updating ... (not very intuitive)
Does anyone know of either a way to KEEP the setInterval running during sleep or stand by mode?
OR does anyone know of a way to determine that you are comming BACk from sleep or standy by mode and to resume the setInterval automatically?
Any help would be greatly apreciated.
Thank you,
Alex
07-05-2011 05:36 AM
has any one find out the solution of it kindly tell...
i am having the same problem
my setinterval and settimeout stops working after backlight goes out ![]()
suggestions needed urgently
07-07-2011 02:55 PM
Hello,
It is not a solution, is plus a possible idea.
Create an extension in java similar to the setinterval function of Javascript, when the device is put to sleep this places the navigator in hibernation and all the code Javascript is stopped.
If you manage to make the extension please they publish it.
07-13-2011 02:14 AM
hi all
i didnt make any extension but what i think is that i can solve my problem after inclosing my page in a browser.field
there i can use all the rimlet api's as well. as i m going to develop web for BB ![]()
07-13-2011 03:21 AM
07-13-2011 06:37 AM
actually what i m doing is that i will call the webpage through an application. see sample code in BB jde for browser field..
by enclosing it in an application u will be able to use rim api's and then increase the time of backlight property