Long running thread + lifecycle
<p>I have a long-running thread which I start on app startup:</p>

<pre><code>public class MyHelper extends Thread {
    private AtomicBoolean mRun;
    public void run() {
        while (mRun.get()) {
            ...
        }
    }
}

public class App extends Application {
    private MyHelper mHelper;

    public void onCreate() {
        mHelper = new MyHelper();
        mHelper.start();
    }
}
</code></pre>

<p>We don't get any "app terminate" signal in Android though, so is the above keeping my app running forever in the background? There's no good place for me to know when to shut the thread down. </p>

<p>I wonder if the user pops the last activity from the stack (by hitting the back button), will my Application instance get destroyed even though the Thread is still possibly in a waiting state?</p>

<p>Thanks</p>
