从当前Activiy界面定时跳转到下一个Activity界面(可用于启动界面)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
getSupportActionBar().hide();//隐藏标题栏
Thread t=new Thread(){ //定义线程
@Override
public void run() {
super.run();
try {
sleep(2000);//睡眠2秒
Intent intent=new Intent(Splash.this,Login.class);
startActivity(intent);
finish();//注销此界面
} catch (InterruptedException e) {//抛出异常
e.printStackTrace();
}
}
};
t.start();
}