title: How can I shutdown thread not in use?
body: <p>I am struggling with an Android app to handle things new to me. I created a thread, persistent message subscriber, in my app waiting for the messages from server in the background. When I exit my app, the thread is still working. Actually, the thread try to connect again and again when it fails to connect to server. So I want to check my app is down or stil alive, otherwise  I want to make my app send some message to the thread to stop before it goes down.</p>
  <p>What ways would be there to do that in Android?</p>