[Solved] How to stop the thread in android activity [duplicate]
In onStop() method, call interrupt as follows: yourThreadObject.interrupt() and in the run() method of the thread, have a condition that checks for Thread’s interrupt status. Depending on your implementation, you might want to enclose this check within a while loop as, public void run() { while (!Thread.interrupted()) { //do something … } } or you … Read more