直接上代码:
public class WelComeActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.welcome_layout);
Timer timer=new Timer();
TimerTask task=new TimerTask() {
@Override
public void run() {
Intent intent=new Intent(WelComeActivity.this,MainActivity.class);
startActivity(intent);
WelComeActivity.this.finish();
}
};
timer.schedule(task,2000);
}
}
注释:
1.requestWindowFeature(Window.<