Well, it depends.  If you actually need to use the application context,
that means you are allowing your service to get destroyed while still bound
to the other service, and in general I would assume that is a bug in the
app.  You probably shouldn't be doing stuff after your service is
destroyed, and if you aren't implementing the correct management of that
binding in your lifecycle, who knows what else is going wrong?

So you should definitely not just be switching to the application context
because you find your service context being destroyed on you when you don't
expect it.  You should clearly understand if you are doing something that
is supposed to extend from outside the lifecycle of the hosting service
(which honestly should be relatively rare).

On Mon, Feb 6, 2012 at 5:38 PM, Zsolt Vasvari <[email protected]> wrote:

> Ok, thanks, Dianne.
>
> So it's OK (and desired) to bound to a service from an IntentService using
> the Application Context, since the bound service is asynchronous and as
> Mark pointed out, the Intent Service finishes right away?
>
> --
> 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
>



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