I want the toast message to display(if clicked on the right answer), but not go to the next activity directly. So i want to set a timer for like 2 seconds so the user can easily read it, and then go to the next activity. What is wrong with this code?
public void rightAnsnextQ (View view)
{
Intent intent = new Intent(this, ThirdQuestion.class);
Toast.makeText(this, "Good job", Toast.LENGTH_SHORT).show();
Thread.sleep(2000);
startActivity(intent);
}