Android 使用小技巧之 :new Handler().postDelayed() 延迟intent跳转

关键点:  newHandler().postDelayed(Runable,delaytime);//其中Runable:包含intent跳转的线程;delaytime:延迟时间1000代表1秒
例子如下:
Runnable r = new Runnable() {
	@Override
	public void run() {
		// TODO Auto-generated method stub
		startGoPage();
	}
};

new Handler().postDelayed(r, 2000);


void startGoPage(){
Intent intent = new Intent(xx.this,xxx.class);
startActivity(intent);
finish();
}


你可能感兴趣的:(android)