You are on page 1of 2

Start a new activity

you can use the CountDownTimer


have look on code
public class CountDown extends CountDownTimer{
private Activity _act;
private Class _cls;
public CountDown(long millisInFuture, long countDownInterval,Activity act,Class cls) {
super(millisInFuture, countDownInterval);
_act=act;
_cls=cls;
}
@Override
public void onFinish() {
_act.startActivity(new Intent(_act,_cls));
_act.finish();
}
@Override
public void onTick(long millisUntilFinished) {
}
}
You can use this on Your SplashActivity as following
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
CountDown _tik;
_tik=new CountDown(1000,1000,this,YourNextActivity.class);// It delay the screen for 1 second and
after that switch to YourNextActivity
_tik.start();

StartAnimations();
}

Cheers

You might also like