Try this:

Create a set of volatile variables (toPause, isPaused, toStop,
isStopped).

Outside the thread, in the methods mentioned previously, set or clear
the appropriate variables.
Inside the thread, be checking the appropriate variables to determine
if the thread needs to be paused or stopped.

Put the use of the variable within synchronized blocks.
Use wait and notify to avoid busy polling.

--~--~---------~--~----~------------~-------~--~----~
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