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
New Developer
jeffm
Posts: 26
Registered: ‎11-20-2008
My Device: Not Specified

Application.invokeLater(Runnable runnable, long time, boolean repeat) not reliable

Hello,

 

I have an application which uses invokeLater to delay an action for a configurable amount of time. For durations less than 60 seconds, it seems to work fine. However, delays approaching 200+ seconds seem to behave erradicaly, with the should-be delayed runnable actually getting executed at all kinds of crazy times from anywhere between 30-200 seconds. I suspected that other processes may steal resources away from the invokeLater thread causing its timer to become inaccurate or something to that effect, but in that scenario I would expect the invokeLater to execute only late and never early. I plan on switching to my own TimerTask as I am fairly certain this does not suffer from such problems but I was wondering if anyone had any insight on this.

 

Jeff

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Application.invokeLater(Runnable runnable, long time, boolean repeat) not reliable

Have you looked in to using the Timer that is already baked into the API?

 

See TimerTask and Timer.

 

 

Please use plain text.