Handler.postdelayed
<p>I am using handler.postDelayed method to create some delay for some animation stuff. </p>

<p>With that i am playing some song as well using Mediaplayer. User can exit this action class by clicking next. But on next screen the same song is continuing even though i called stop method in the next button's onclicklistener. </p>

<p>Is it due to the timedelay that is added which gets executed after the next activity is loaded. Any idea?</p>

<pre><code>handler.postDelayed(new Runnable() {
        public void run() {
            mp = MediaPlayer.create(getApplicationContext(), R.raw.num2);
            mp.start();
            imageView1.setImageResource(R.drawable.countcat2);
        }
    }, 2000);
</code></pre>
