Mediaplayer stop is not working
<p>I have got a MediaPlayer object as class attribute.</p>

<pre><code>    MediaPlayer mp;
</code></pre>

<p>Then I use them in my onCreate method - </p>

<pre><code>        mp = MediaPlayer.create(getApplicationContext(), R.raw.num1);
    mp.start();
</code></pre>

<p>Then I try to stop it from one of my buttons clicklistener like this - </p>

<pre><code>        btnBack = (Button) findViewById(R.id.btn1);     
    btnBack.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            stopSound();
            startActivity(new Intent(Five.this, Four.class));
            finish();

        }
    });
}

public void stopSound(){
    if (mp != null) {
        mp.release();
        mp.stop(); 
    }
}
</code></pre>

<p>but the stop does not work.  </p>

<p>What am i doing wrong?</p>
