One simpler approach would be having a specialization of a Handler created with separate thread/looper. It would be instantiated along with the activity and you can post messages or Runnables with object and the Handler does the work in background. The handler should post Runnables or messages to the main handler. Call quit on the handler from the onDestroy. The handler will be "sleeping" when there is noting to do. It also provides the synchronization of the operations.
Fernando On Feb 23, 8:50 am, Jake Colman <[email protected]> wrote: > >>>>> "MM" == Mark Murphy <[email protected]> writes: > > MM> On Wed, Feb 23, 2011 at 11:05 AM, Jake Colman <[email protected]> wrote: > >> Dumb question: Which one did I use in the code snippet that I > >> showed you in my prior post? > > MM> Beats me. It was your code... :-) > > My service class was extending Service, not IntentService, so that > answers my own question! > > Looks like the basic difference is that IntentService will automatically > spin off a worker thread do the work as opposed to doing in the Service > itself? But if the Service is already in a running context unto itself, > what is the benefit of splitting its own into yet another thread? > > Also, the docs state that you do NOT need to call stopSelf() in an > IntentService yet you prior post indicated that I should. Is that > because you were thinking Service? > > -- > Jake Colman -- Android Tinkerer -- 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

