ack - nevermind. rtfm. boolean onUnbind(Intent intent) Called when all clients have disconnected from a particular interface published by the service.
On Sep 11, 8:01 pm, sdphil <[email protected]> wrote: > i have a service that's running in the background, is there any way > (short of keeping a count of onBind() and onUnbind()) to know the > number of activities that are bound to it? > > I am trying to provide a "quit" function. all my activities derive > from the same base class. I am keeping a global static around that > says the "quit" button was pressed. then on each of the activities > onResume() method, I look for the global static "quit" variable and if > it's set to true, I call "finish()" so my activity shuts down, and > then next activity on the task stack appears -- which goes through the > same process of checking the global static "quit" variable until it > gets to the root activity -- which effectively goes back to the main > desktop screen. > > However, I need a way to reset the global static "quit" variable, > otherwise, when I launch the app again, it will check the global > static quit variable and shutdown immediately - never coming back up. > So, I want to know if there are any activities bound to my service, if > not, I would set the global static "quit" variable back to false so > that the app could be relaunched again. > > tia. > > p.s. I know the general philosophy about not having a quit button, but > I think in this case it's justified. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

