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: 1,638
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido
Accepted Solution

Background Timer help

I want to schedule some alarms that go off when the my app is NOT active or running.

 

 

TimerTask myTask = new myTimerFunc(); myTimer = new Timer(); myTimer.scheduleAtFixedRate(myTask, 6000, 6000);

 

The timer goes off if the app is active but as soon as i exit the app the timer does not work.

How do i make the timer run in the background?

 

 

Highlighted
Developer
Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified

Re: Background Timer help

You have to leave your app on (at least that's what I do).

 

UiApplication.getUiApplication().requestBackground();

New Contributor
Posts: 3
Registered: ‎07-13-2010
My Device: Storm 9550
My Carrier: Developer

Re: Background Timer help

Hi,

 

Can you post the code, because I`m trying to do the same thing but I dont know why I cannot!