android - Background music starts when relaunch -


I used the media player to create background music in my menu game. It seems to work correctly but when I start another activity, I'm going back to the menu. The voice disappears whenever the menu activity launches, how can I play it again?

Listens to some of my codes:

  logoMusic = MediaPlayer.create (NewamActivityIs, R.O.O.OnPoices_sound); LogoMusic.start ();  

Then on my stopover:

  Pause on secure punctuation () {super.onPause (); LogoMusic.release ();  

Use the onRestart method for this.

@override protected void restart () {super.onPause (); Logomusic = mediaplayercredit (new maneactivityIs, r.ro.onpause_sound); LogoMusic.start (); }

It will be said only when you return to activity, not when you open it for the first time.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -