In the first half of your question: you should get what you want if you call stopMediaPlayer()inside onPause()and onDestroy(). Example:
@Override
protected void onPause() {
super.onPause();
stopMediaPlayer();
}
In the second half: try taking a look at the AudioManager class (especially AUDIO_FOCUS_GAIN ) and see if it can handle what you're looking for.
, , ... , 90-, MIDI-, , , ...