title: Trouble with sound effects at Onclick (Null Pointer and MediaPlayer Warning
body: <p>I have created a simple Ukulele tuner (The market I think lacks a visually pleasing and extremely simple tuner). </p>
  
  <p>Any how, firstly, through the developer console I can see that there is a Null Pointer Exception at the Button Onclick Events. I have not been able to recreate this, however it has been reported four times.</p>
  
  <p>Secondly, looking at the log while using the app I can see this warning;</p>
  
  <pre><code>E/MP3Extractor(68): Unable to resync. Signalling end of stream.
  </code></pre>
  
  <p>This entry here <a href="https://stackoverflow.com/questions/6977511/mediaplayer-array-causing-null-pointer-in-android">MediaPlayer array causing null pointer in Android</a> seems to be along the same lines.</p>
  
  <p>How it works.
  Through the use of radio buttons the user selects either to play a single note or a continuous note. I have created a subroutine called StopMediaPlayer that stops, resets and instantiates the MediaPlayers again. This was used because I could never seem to stop the continuous play back but only pause it.</p>
  
  <p>Is the warning and the NullPointerException related? Is there a more efficient/better means of stopping MediaPlayer that will mean that I wont have to re instantiate the notes every time.</p>
  
  <p>Thank You </p>
  
  <p>One of the offending Onclicks </p>
  
  <pre><code>Button gButton = (Button) findViewById(R.id.gButton);
      gButton.setOnClickListener(new OnClickListener() 
      {
          public void onClick(View v)
          {
              if (singleRadio.isChecked() == true)
              {
                  StopMediaPLayer();
                  gNote.setLooping(false);
                  gNote.start();
  
  
              }
              else if (contRadio.isChecked() == true)
              {
                  StopMediaPLayer();
                  gNote.setLooping(true);
                  gNote.start();
              }
  
          }
      });
  </code></pre>
  
  <p>Stop Media Player Subroutine</p>
  
  <pre><code>public void StopMediaPLayer()
  {
      Log.i("UkuleleTuner", "Stop Media Player");
      gNote.setLooping(false);
      cNote.setLooping(false);
      eNote.setLooping(false);
      aNote.setLooping(false);
  
      gNote.stop();
      cNote.stop();
      eNote.stop();
      aNote.stop();
  
      gNote.reset();
      cNote.reset();
      eNote.reset();
      aNote.reset();
  
      gNote = MediaPlayer.create(this, R.raw.g_note);
      cNote = MediaPlayer.create(this, R.raw.c_note);
      eNote = MediaPlayer.create(this, R.raw.e_note);
      aNote = MediaPlayer.create(this, R.raw.a_note);
  }
  </code></pre>