代码
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(StarActivity.this,
MainActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.in_from_right,
R.anim.out_to_left);
StarActivity.this.finish();
}
}, 4000);