If you just create your thread, it will keep running for as long as the process is alive.

You won't want a thread doing something CPU intensive continuously, so presumably some kind of queue with "work items" would be a good way to "put it on pause".

As far as termination, threads are contained in processes, so when your app's process is killed, all its threads, including any that you create, will just disappear (e.g. binder threads, WebViewCoreThread, the WebView cookie saving thread, AsyncTask threads, etc, etc, etc).

You might also want to consider one of: HanderThread, AsyncTask, IntentService, or a blocking queue...

-- K

11.05.2012 15:23, RLScott написал:
OK, maybe that question was too big.  All I really need to know is can
I create a static thread that runs throughout the lifetime of the app
and not worry about thread termination, trusting that if the OS needs
to stop my app's process then it will close down that thread neatly
without system resources left hanging?  The thread does not deal with
files.  It's only interaction with the rest of the app is through
static variables.


--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to