Implement the onPause (or onStop) of your Activity. Pause your thread there 
(i.e. have your thread check for a value/semaphore that indicates when to 
pause a thread). In the onResume (or onStart), resume your thread.

Implement the onDestroy of your Acivity. Stop your thread there (i.e. exit 
the Thread's *run *method entirely).
If your thread needs to survive configuration changes (e.g. orientation 
changes, keyboard slide-outs and slide-ins), you need to do a bit more work 
so that in those cases, your thread is not stopped in onDestroy.

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

Reply via email to