[android-developers] Re: What is causing Service not registered from unbind(service)?
Dear, On Fri, Dec 12, 2008 at 7:19 PM, Dianne Hackborn hack...@android.com wrote: On Fri, Dec 12, 2008 at 3:56 AM, zero zeroo...@googlemail.com wrote: o_0'' for real ?!? that would mean i'm depending on luck and good faith then calling anything on that connection. oh, well. in the garbage collector we trust ;-) The IBinder communication channel between the application and the service is direct, so once you have it you can continue to call it until the service's process goes away or the service deliberately decides otherwise. this is a two way communication? I'm planning to have an activity that send data to a remote service and vice-versa (and I need to use a Remote Service!). It is possible to set a callback that allows the activity sends data to a remote service? (the example with remote service uses callback to the communication Service - to - Activity). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: What is causing Service not registered from unbind(service)?
On Fri, Dec 12, 2008 at 3:56 AM, zero zeroo...@googlemail.com wrote: o_0'' for real ?!? that would mean i'm depending on luck and good faith then calling anything on that connection. oh, well. in the garbage collector we trust ;-) The IBinder communication channel between the application and the service is direct, so once you have it you can continue to call it until the service's process goes away or the service deliberately decides otherwise. but something is still bugging me: further observations seemed like that it's depending on whether i call service.unregisterCallback (myCallback) before unbind(,,) or not. if i don't, the error goes away, but the callback gets leaked. would it be a better strategy to make the service throw away the callbacks by itself then it gets unbound ? The service only knows when -all- clients have unbound. You can certainly remove all callbacks at that point, but I that won't really cover all cases. If you look at the ApiDemos example, though, it does deal with things like the client process going away and clean up all callbacks at that point. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: What is causing Service not registered from unbind(service)?
It means that ServiceConnection is not bound to the service. Just because you can call methods on the IBinder you got at some previous point doesn't mean you are still bound to it. (A little unfortunate, for for efficiency's sake there it is.) On Thu, Dec 11, 2008 at 3:33 PM, zero zeroo...@googlemail.com wrote: Hi all i have a remote service running while the controlling activity is not displayed. i call unbind(mConnection) in onPause, which sometimes works and sometimes throws Service not registered. I know i'm bound to the service (doing the bind in onCreate), because i can execute it's functions. so why is it unregistered and how can i prevent that ? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---