multithreading - BlackBerry - Does TimerTask run in the background? -


Does timer Task work even on exit from my work and comes to the Home screen or other app detected Could? I have read the forum and to find the easy way to thread type, use the timer cookies in BB. I should always have a running bag, my app has not been launched (after the first time) so that when a particular interval comes, I can show my dialogue with the application. I tried the following: (I get this code, rather than main screen screen, click on main screen)

  try {timer = new timer}; // Start after 1 second, repeat every 5 seconds / timer schedule (new clickTest (), 0, 5000); // seconds * 1000 timers. Schedulatile Factorat (new clickTask (), 0, 5000); } Hold (exception e) {// nothing} Private class ClickTask TimerTask extended {public zero run ({{System.out.println ("test printing .."); // Screen Screen = New Dialog (Dialog.D_OK, // "Watch Out !!!", Dialog.OK, // bitmap.jeteditbitmap (bitmap.exclamation), // ManagerVERTICAL_SCROLL); }}  

But this timer runs only when my application launches. If I exit my application and come to the Home screen, then the log (i.e. timer is not running). Is my code correct? Is this the way to run a timer in the background as a thread? Note: I am testing it for 9530 simulator.

Thank you for your help.

TimerTask happens when your application is actually running.

After an interval see for launching your application.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -