Quantcast
Channel: IllegalStateException when trying to schedule a timer - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Cardinal System for IllegalStateException when trying to schedule a...

As Krish mentioned, you cannot reuse the TimerTask. If you want to, however, you can use Runnable instead of TimerTask and execute it with a ScheduledExecutorService. See this answer for an example.

View Article


Answer by Krish for IllegalStateException when trying to schedule a timer

You can not reuse the timertask . Create new instance of TimerTask.

View Article

IllegalStateException when trying to schedule a timer

From the documentation of the cancel method:(Loosely speaking, this method returns true if it prevents one or more scheduled executions from taking place.)And when I execute this code:private Timer...

View Article
Browsing all 3 articles
Browse latest View live