I want to change the background of a button to red and then wait for one second before calling another activity.
This is my code:
btn1.setBackgroundColor(Color.RED);
SystemClock.sleep(1000);
startActivity(intent);
The problem is that the application sleeps for one second and starts the activity, but the color of the button does not change. How can I fix this?