Categories: Java | Java ME | How To | Code Examples | Base/System
This page was last modified 09:05, 27 November 2007.
How to execute a repeated scheduled task
From Forum Nokia Wiki
If you want to create an repeated scheduled task every xxx milliseconds in Java ME you should use a TimerTask class, inserting the code in the run method.
public class MyTask extends TimerTask { public void run() { // Code to execute } }
Then, we should use this task in this way:
crono = new Timer(); task = new MyTask(); // Schedule every 1 second starting right now crono.schedule(task, 0, 1000);
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 怎样在程序里面打开SIS文件? | paulcheung | Symbian | 1 | 2006-11-13 13:53 |
| Use CCoeControl in another thread? | Allen3 | General Symbian C++ | 17 | 2007-03-05 16:06 |
| help: developing sms filter for s60 phones | vsalak | General Messaging | 21 | 2006-01-02 05:01 |
| a problem about inter-app communication | zengjianguang | General Symbian C++ | 2 | 2008-04-25 01:10 |
| autostart doesnt work | white_dragon | General Symbian C++ | 9 | 2007-04-20 13:59 |
