Re: [android-developers] Thread Problem
When I set *yourThread.instanceBooleanAttribute = false;* , the Thread may be sleeping. How to destroy a sleeping thread? thanks,Krishna -- 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
Re: [android-developers] Thread Problem
If the thread is sleep()-ing or wait()-ing, call notify() to wake it up. -- Kostya 07.03.2011 8:39, Krishna Shetty ?: When I set *yourThread.instanceBooleanAttribute = false;* , the Thread may be sleeping. How to destroy a sleeping thread? thanks,Krishna -- 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 -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- 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
RE: [android-developers] Thread Problem
From within the thread, throw new ThreadDeath(); (which is what stop() does). Or anything else that causes it to exit out of the Runnable.run() method. Ted Neward Java, .NET, XML Services Consulting, Teaching, Speaking, Writing http://www.tedneward.com -Original Message- From: android-developers@googlegroups.com [mailto:android- develop...@googlegroups.com] On Behalf Of brijesh Sent: Thursday, June 17, 2010 3:40 AM To: Android Developers Subject: [android-developers] Thread Problem Hello, I want to stop currently running thread but -Thread.stop() - Thread.destroy() are DEPRECATED so can any one tell me how to stop the Thread -- Regards, Brijesh Masrani -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android- develop...@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 -- 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
Re: [android-developers] Thread Problem
Hi Brijesh, You have a *while(true){...}*, haven't you? Change it to: *while(instanceBooleanAttribute){...}* Now, you can stop the Thread process from another Class, simply calling *yourThread.instanceBooleanAttribute = false;*. Roc Boronat from Barcelona http://piposerver.com -- 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
Re: [android-developers] Thread Problem
In your thread you probably have something like: public void run () { while (true) { doSomeWork(); } } what you need is a boolean var that checks whether to continue 'doing work', or stop the thread. Like this: public void run () { while (!stopThread) { doSomeWork(); } } Then, when you want to stop the thread, set stopThread to true. Yuvi On Thu, Jun 17, 2010 at 12:40 PM, brijesh masrani.brij...@gmail.com wrote: Hello, I want to stop currently running thread but -Thread.stop() - Thread.destroy() are DEPRECATED so can any one tell me how to stop the Thread -- Regards, Brijesh Masrani -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroid http://android.yuvalsharon.net -- 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