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
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Timer.schedule(..) Question

Hello,

I try to use the Timer.schedule(TimerTask task,long delay,long period) API but somehow I don't do it right.

So I want to call this timer every 20 minutes. Here is my code:

 

timer.scheduleAtFixedRate(new CountDown(),5000, (20 * 1000) * 60);

 

where

20 is the number of minutes

1000 is the conversation to milliseconds 

60 is the conversation to seconds

 

whaat am I doing wrong? Doesn't that execute the timer every 20 minutes?

 

Thanx.

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Timer.schedule(..) Question

the call seems allright to me.
care to show the (relevant) code of CountDown()?
where do you call this code?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter