Answer the question
In order to leave comments, you need to log in
Java - how to truly stop the execution of a thread?
I noticed such a thing - when I try to stop the Thread (using stop() or interrupt()) or AsyncTask (using cancel(true)), the code in the thread still continues to be executed!!!
Google offers solutions such as setting a flag and constantly checking this flag in the stream, it is not clear what to do if I have one long operation, the code of which I do not have.
Is it really impossible to completely stop the execution of a thread, or am I missing something?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question