title: Stop MediaPlayer when an other app play music
body: <p>In my app, I have a media player which play a stream music:</p>
  
  <pre><code>globalVariable.setPlaying(true);
  final ProgressDialog mProgressDialog;
  mProgressDialog = ProgressDialog.show(MainActivity.this, "Chargement en cours", "La musique est en train de charger", true);
  
  String url = "http://178.32.181.86:18000";
  globalVariable.mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
  
  try {
      globalVariable.mp.setDataSource(url);
  } catch (IOException e) {
      e.printStackTrace();
  }
  
  globalVariable.mp.prepareAsync();
  
  globalVariable.mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
      @Override
      public void onPrepared(MediaPlayer mp) {
             mp.start();
             bouton.setImageResource(R.drawable.pause);
             mProgressDialog.hide();
      }
  });
  </code></pre>
  
  <p>It works very fine. When I open another app in front of mine, player continues, and it's great. But if I launch another player (like GooglePlayMusic or youtube), my app doesn't stop music and I have two sounds in the same time.</p>
  
  <p>So I want that my music stop if another app need to play music.</p>
  
  <p>Thanks a lot</p>