How to Stop MediaPlayer
<p>i have a problem. my media player doesn't stop even activity has stopped. so i confuse why media player doesn't stop. media player immediately playing until a mp3 finish. here my code</p>

<pre><code>public class Isi_TakbiratulIhram extends Activity{
MediaPlayer mp;
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.isitakbiratulihram);

    ImageButton iftitah1=(ImageButton) findViewById (R.id.takbiratulihram1);
    iftitah1.setOnClickListener(new OnClickListener(){
         @Override
        public void onClick(View v){
            go();
         }
        public void go(){

            if(mp != null ){
                mp.stop();
                try {
                    mp.prepare();
                } catch (IllegalStateException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                mp.seekTo(0);

                mp = null;

            }
            else {
                mp=MediaPlayer.create(Isi_TakbiratulIhram.this, R.raw.iftitah1);


            mp.start();


            }




 }});
</code></pre>

<p>thanks for help</p>
