We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How to stop the music when game is received to the background ?
@hamza===
as for that you can use the onPause() && onStop() mehods.
Can you give me an example code ?
depends of the sound is it from mediaplayer? is it from audio service? is it from audio track?
yet principle is the same let us say you are using some instance from MediaPlayer, mp:
public void onPause{ super.onPause(); if(mp!=null){ mp.stop(); mp.release(); mp=null; } }
same code for onStop();
Thank you akenaton :)
Answers
@hamza===
as for that you can use the onPause() && onStop() mehods.
Can you give me an example code ?
depends of the sound is it from mediaplayer? is it from audio service? is it from audio track?
yet principle is the same let us say you are using some instance from MediaPlayer, mp:
same code for onStop();
Thank you akenaton :)