timer already canceled
as u can see in the file, i am scheduling two tasks using TimerTask, and in the first line of the code in each task, u will see that i am returning if
huntEnded
is true, and while that works fine, the reason i am doing it like that is because, when i set the huntEnded
to true and try to do timer.cancel()
i just get a Timer already canceled
, and i dont understand, why? i am not even trying to cancel while the task is being executed
(sorry but i cant provide any error messages, i had this issue a while ago and replicating the thing will be painful but it basically just said timer already cancelled and pointed to the line where i have the timer.cancel()
)13 Replies
⌛
This post has been reserved for your question.
Hey @MoonSouhayl! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
How are you calling cancel?
it was smth like this
if thats what ur asking about
so you attempt to cancel the whole timer?
not a specific task?
yep...
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
tbh I don't like
Timer
, I prefer ScheduledExecutorService
lolUnknown User•8mo ago
Message Not Public
Sign In & Join Server To View
i meaaaaaan
it isn't part of JavaFX
im using Timer cause i wrote Time and intelliJ gave it to me
gonna take a look at
ScheduledExecutorService
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.