anroid 頁面停留幾秒後跳轉

android默認頁面幾秒後自動跳轉另一頁面

 
super.onCreate(paramBundle);
setContentView(R.layout.splash_screen_view);
final Intent localIntent=new Intent(this,Main.class);
Timer timer=new Timer();
TimerTask tast=new TimerTask()
{
@Override
public void run(){
startActivity(localIntent);
}
};
timer.schedule(tast,DELAY);

pretendIntent。
或者用線程sleep(3000),然後發起一個intent
比如:
try{
sleep(1000);
}catch (Exception e) {
}
Intent intent = new Intent(this,XXXX.class);
startActivity(intent);
這樣1秒後,就會跳轉到另一個activity了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章