9
What is the right way of doing foreground service which I can later bind to it? I have followed Android API demo which includes an example how to create foreground service. There is no example about start service in bind to it at same time.
I want to see one good example of music player service with activity "bound" to it.
Is there any?
I want to do something like:
- When a program is first (first means that service isn't started yet) started I want to start foreground service which do all the job. User Interface (activity) is just to control that job
- If user presses home button service must stay up and running (and notification in bar must be present)
- Now if user click on notification in notification bar activity should start and bind to service (or something like that, the right way) and user takes control over the job.
- If activity is active and user presses back button activity should be destroyed and also service should be destroyed.
What methods do I have to override to accomplish this task? What is the Android way of doing this?