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 <[email protected]> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> 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 [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