Null out all references to the thread. Java has a problem with zombie threads -- this is a java app right?
I can't say exactly how you should do the following but make sure there is an explicit way to exit each thread. I usually set a flag to tell the thread to exit. Those two things -- null all references and setting an explicit exit flag are the most you can do. After you null all references to the thread, do an explicit gc() if that's available. Gabriel Simões wrote:
Hello, Today, while debugging and app that uses AsyncTask to record audio and update UI I noticed that everytime that an AsyncTask object ends running (finishes doInBackground() and onPostExecute() or onCancelled()) it´s thread stays alive (running status). At least for me that should not be the behavior of the class since the doInBackground task may not stay running forever (as an example the android manual says that a status bar should be updated by an asynctask, and it won´t last for the whole app running time). Is there anything I´m missing, as a method to destroy it, or should I just ignore and keep creating threads as I need and the VM will handle them as it needs resources? Thank you, Gabriel Simões
-- 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

