Try this:
public class TicketFinalActivity extends Activity {
private final int DELAY_TIME = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
try {
Intent i= new Intent(TicketFinalActivity.this, Caution.class);
startActivity(i);
}
catch (Exception e) {
Log.i("TAG", "Error: " + e.getMessage());
finish();
}
}
}, DELAY_TIME);
}