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
Post a Comment