Actually on the net or stackoverflow I cant find the thing I need,maybe I do not searched the real keyword on google so I cant find my solution. I play a sound(.mp3) ,it works fine. code is here:
try {
MediaPlayer mPlayer = MediaPlayer.create(context, R.raw.bell);
mPlayer.start();
} catch (Exception e) {
// TODO: handle exception
}
My problem is when I take my phone sound is off or vibrate , this code runs and I hear the sound.How can I detect phone sound is not open so I can stop the player, Thanks in advance