After performing an action,how to delay the starting of a new action?
<p>I have a variable and I have set it to 3. every time when button is clicked it is          decremented and required action is performed. when it reaches 0 i want action should be display on the screen for a while and then it moves to new activity.</p>

<p>But problem is when it reaches 0 it does not hold for a while for the user to see the what action is performed it simply jumps to next page ...
is there any way to do this?</p>

<p>the code I'm using is:</p>

<pre><code>if(ch==0)
{
try {

        Thread.sleep(15*1000);
    startActivity(new Intent("com.example.quizproject.Menu"));
} catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
}
</code></pre>

<p>after using this code,the variable reaches 0 , it doesn't finishes the previous action rather pause then move to the next activity.</p>

<p>Any possible solution for this problem?</p>
