title: Playing Sound Using the Android MediaPlayer in a switch statement
body: <p>I am trying to get my application to play sounds when the current exercise is shown on screen. The problem I'm having is that the sound keeps repeating once it is played. I want the media player to play the sound once. I have a count down timer running also and the exerciseCount is 0 for 15 seconds before changing. The sound keeps repeating on each number that the clock counts down. How to i get the sound to play only once?         </p>
  
  <pre><code>        switch (currentExercise){
       case 0 :
            mp.reset();
            mp = MediaPlayer.create(getBaseContext(), R.raw.lunges); 
            mp.start();
        break;
       case 1 :
            mp.reset();
            mp = MediaPlayer.create(getBaseContext(), R.raw.abdominalcrunches);
            mp.start();
        break;
       case 2 :
            mp.reset();
            mp = MediaPlayer.create(getBaseContext(), R.raw.pushups);
            mp.start();
        break;
       case 3 :
            mp.reset();
            mp = MediaPlayer.create(getBaseContext(), R.raw.squats);
            mp.start();
        break;
       case 4 :
            mp.reset();
            mp = MediaPlayer.create(getBaseContext(), R.raw.rest);
            mp.start();
        break;
  
        }
  </code></pre>