On Wed, Feb 23, 2011 at 11:50 AM, Jake Colman <[email protected]> wrote:
> 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?

A Service does NOT run on its own thread. Just as an Activity does not
run on its own thread. Just as a BroadcastReceiver does not run on its
own thread.

Rather they ALL share ONE thread -- the main application thread. There
are serious limitations as to what you want to do on that thread, to
avoid "janky" UIs and "ANR" crashes.

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

I meant that IntentService uses stopSelf() internally. If you
implement a Service and you wish to stop yourself, you can call
stopSelf().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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

Reply via email to