IntentService implements onStartCommand() to put the incoming commands into
the queue for its thread.  You can control the return option it uses with
this:

http://developer.android.com/reference/android/app/IntentService.html#setIntentRedelivery(boolean)

On Wed, Jun 30, 2010 at 1:08 AM, Federico Paolinelli <[email protected]>wrote:

> Just one last question (I hope): will the onStartCommand  be called on
> my IntentService? Should I put the code to handle the intent?
> I expect I don't have to since it must be handled in onHandleIntent.
> What value should I return in onStartCommand? Or is it just enough not
> to override it and implement only onHandleIntent?
>
> Thanks a lot for your support.
>
> Federico
>
> On 30 Giu, 02:14, Dianne Hackborn <[email protected]> wrote:
> > Yes the intents will be enqueued and handled one at a time on the other
> > thread.  Context.startService() is always asynchronous, no matter what
> the
> > service does.
> >
> > IntentService derives from Service (it is a convenience class
> implementing
> > one common Service pattern), so it inherits all of the functionality of
> > Service.
> >
> > On Tue, Jun 29, 2010 at 3:09 PM, Federico Paolinelli <[email protected]
> >wrote:
> >
> >
> >
> > > I have to process some events given by a broadcast receiver.
> > > As kindly suggested by Mark M. a week ago, I am trying to send the
> > > intent to an intentservice in order to pass the data to be processed
> > > to another thread.
> >
> > > Looking at the doc, I can read abot onHandleIntent:
> > > "Only one Intent is processed at a time, but the processing happens on
> > > a worker thread that runs independently from other application logic.
> > > So, if this code takes a long time, it will hold up other requests to
> > > the same IntentService, but it will not hold up anything else.
> >
> > > What does it mean? Will the intents be queued and then processed one
> > > by one, or does it mean that the startService will block if the
> > > intentService is busy processing a previous intent?
> >
> > > And more (this is just my curiosity):
> > > What is the point in having a onStartCommand method in IntentService
> > > if the Intents must be processed in "onHandleIntent"?
> >
> > > Why the IntentService has all the onBind facilities if it will die
> > > when it finish its job?
> >
> > > Thanks a lot in advance,
> >
> > >   Federico
> >
> > > --
> > > 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]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > [email protected]
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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