This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem whiile using Timer and TimerTask Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem whiile using Timer and TimerTask" Watch "Problem whiile using Timer and TimerTask" New topic
Author

Problem whiile using Timer and TimerTask

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Hi

I have created a Window Service in java and also created one class using java.uti.Timer and java.uti.TimerTask.

I extended my class by TimerTask, so i have to implement run() methord in my class and i have done that.

My programme is running fine like i want to call my run methord after every 1 min which is running successfully but when i write some methord in my run() methord like



In the above case it goes to a() methord do its work and just dies out there , but it should continue as its in timer.

Can you please tell me that where i am lacking.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
Have you set up the task for repeated execution? You'd do that using the various "schedule" methods that take a "period" parameter.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem whiile using Timer and TimerTask
 
Similar Threads
How to check if a timer is still running or not ???
Timer & TimerTask - Name of Timer Object
Timer, Again
Problem with Timer and TimerTask
java.util.Timer inside Runnable?