On Sun, Feb 5, 2012 at 5:38 PM, Zsolt Vasvari <[email protected]> wrote:
> Well, I made my change, but one of the uses for the Context is bind to a
> service.
>
> This now fails sometimes on unbind() with a "Service not registered"
> message.
>
> I asuume I still have to use the Application Context to bind to services?

"Have to" is a strong term. However, particularly for activities that you:

-- want to have access to a bound service, and
-- want to allow Android to destroy and recreate on a configuration change

then binding from Application is a good idea.

http://commonsware.com/blog/2010/09/29/another-use-getapplicationcontext-binding-rotation.html

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
Available!

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