If your application is properly written, you should be calling release
() on the MediaPlayer object in your onPause() method. There is no
guarantee that your app won't be killed while it's sitting in
background, which will stop the audio.

If you want audio in the background, you need to write a service.

On Feb 1, 4:04 am, "[email protected]"
<[email protected]> wrote:
> I'm using a mediaplayer to play a sound file, when you leave the
> application the sound continues in the background, which is the
> desired behaviour.
>
> However, when the app is resumed, the mediaplayer isn't retrieved, so
> hitting pause just starts a new player so now there are two sounds
> playing.
>
> Is the mediaplayer a type of service? How can I access the original
> player again?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to