If the purpose is to only run while one of your activities is in the foreground, there is no need for a service. Just make a manager class with a global singleton, which the activities use to tell when it should run.
On Tue, Jan 26, 2010 at 4:08 PM, Martin <[email protected]> wrote: > Hi! > > I am programming a game. I have a service for the background-music. > When I press the home-button and leave my activities, the service > still runs in background. How can I stop the service, when there is no > more visible activity in my program and restart it, when the user goes > back to my game (some activity of it)? > > Greetings, Martin > > -- > 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]<android-developers%[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

