• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

binding a service to multiple activities

kilowog3000

Lurker
Mar 28, 2019
1
0
Hi,

I'm developing a music player app, it's my first Android app ever so I'm navigating these waters. So far everything is going decently, a few hangups, etc., but still getting there.

So my question: I have my music service playing and I need to control it from several screens. Think "Google Play" app, "Spotify", were you can do the normal pause, resume, next, prev, etc. from a main category page, a song detail page, and others. I did some googling, and I found the following reference on Stackoverflow:
https://stackoverflow.com/questions/30648766/binding-a-service-to-multiple-activities

While it may seem legit enough, but one subcomment said this is a bad pattern to store variables in the Application itself, use persistence, etc. My question: Does the SO answer make sense, is it correct, or is there a better way I should do this?


Thanks
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones