Well you simply shouldn't start a thread in BroadcastReceiver, as
explained here: 
http://code.google.com/android/reference/android/content/BroadcastReceiver.html
(starting a thread would count as an "asynchronous operation").

A BroadcastReceiver lets you do a quick, on-shot operation in response
to receiving some action from the system.  A service lets you do a
long-running operation where you control its duration.  It is fairly
typical to start a thread as part of a service, since the point of it
is to do a long-running operation while at the same time you don't
want to block the main thread (which is what originally calls the
service) for a long amount of time which would cause your app to
become unresponsive and get ANRs.

On Sep 17, 11:20 pm, elvisw <[EMAIL PROTECTED]> wrote:
> or
> what about starting a service that starting the thread?
>
> On Sep 18, 2:08 pm, elvisw <[EMAIL PROTECTED]> wrote:
>
> > I'm not so familiar with the service mechanism.
> > A simple question here,
> > what is the difference between starting a service and starting a
> > thread in a BroadcastReceiver??
--~--~---------~--~----~------------~-------~--~----~
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