0

Is there any way to get a list of all services bound to an application? It seems there has been cases where my application does not close the service when it should. It works fine when I test it but I've seen cases where it does not seem to close. Which results in two services when there should only be one.

I use this code to bind the service from my activity.

bindService(new Intent(this, XmppService.class), xmppConnection, Context.BIND_AUTO_CREATE);

Is there any way of getting a reference to this bound service and shut it down?

Jimmy Garpehäll
  • 453
  • 5
  • 15
  • 1
    I don't think, there is a way to do this. But have you looked at [this](http://stackoverflow.com/a/3692966/4791726). There will only be one instance of a service. I don't think you will have two running instances of one service. – AlbAtNf Feb 10 '16 at 10:30
  • Thanks for the link. I'm gonna try [this](http://stackoverflow.com/a/15020748/1245158) answer. That could help. It will probably take some time before I can verify the results though. – Jimmy Garpehäll Feb 23 '16 at 07:38
  • Didn't seem to help much with my issue unfortunately. – Jimmy Garpehäll Jun 02 '16 at 15:04

0 Answers0