I used a service to start a Thread, in this thread, I wrote a while loop(I set a flag, while flag is true, the thread runs, if the flag is false, then the thread won't do anything, thus stop the thread manually) in this thread. when I debug my code, I often noticed that the thread is over, but the service was still running. Is it recycled by android system? 

How can I do to prevent my thread from recycling? 

====== EDIT =======

"will by thread be cleaned up by the system automatically before it ends" - means the thread is being killed when it shouldn't be