Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Threads and Services Bound Services Bound and Started

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

So every time we tap on the play music button it creates an intent and starting a service ?

For me it seems not right to create new intent and starting service every time user tap the button to play the music. What happen if the user tap play button repeatedly, would it be starting a lot of PlayService ?? and its not goog for system right ?? Ben Deitch

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Rifqi! If the user tapped the play button repeatedly, it might call 'onStartCommand' a lot, but it will still only take one call to stopSelf/stopService to stop everything so it's not that much of an issue.