Playing BG Music Across Activities in Android
Posted
by scarface
on Stack Overflow
See other posts from Stack Overflow
or by scarface
Published on 2010-01-19T23:06:19Z
Indexed on
2010/04/25
18:13 UTC
Read the original article
Hit count: 227
Hello! First time to ask a question here at stackoverflow. Exciting! Haha.
We're developing an Android game and we play some background music for our intro (we have an Intro Activity) but we want it to continue playing to the next Activity, and perhaps be able to stop or play the music again from anywhere within the application.
What we're doing at the moment is play the bgm using MediaPlayer at our Intro Activity. However, we stop the music as soon as the user leaves that Activity. Do we have to use something like Services for this? Or is MediaPlayer/SoundPool enough? If anyone knows the answer, we'd gladly appreciate your sharing it with us. Thanks!
© Stack Overflow or respective owner