title: Trying to use the same button to play+pause music
body: <p>I have recently tried to create a button that says "Play", and when this button is pressed, I wanted it to play the music then change the text to "Stop", but it throws an error and quits the app. Here is my code:</p>
  
  <pre><code>        mPlay.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              if(ourMusic.isPlaying()){
                  ourMusic.pause();
                  mDisplay.setText("Play");
              }else{
                  ourMusic = MediaPlayer.create(MainActivity.this, R.raw.killthenoise);
                  ourMusic.start();
                  mDisplay.setText("Stop");
              }
          }
      });
  </code></pre>
  
  <p>So if you press the button once it should play, press it again it should stop the music. There is no errors in the actual coding.
  Here is my logcat: <a href="http://pastie.org/7970711" rel="nofollow">http://pastie.org/7970711</a></p>
  
  <p>I am new to this stuff, so I don't know too much of whats going on. Any help would be appreciated.</p>