代碼如下:
public class LoadActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);// 去掉標題欄
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.load);
change();
}
protected void change()
{
final Intent it = new Intent(this, MainActivity.class);
Timer timer = new Timer();
TimerTask task = new TimerTask()
{
@Override
public void run()
{
// Intent intent = new Intent(LoadActivity.this,
// MainActivity.class);
// // LoadActivity.this.finish(); i = false; } };
startActivity(it);
}
};
timer.schedule(task, 2000);//停止2s後由游戲載入頁面再跳轉到游戲菜單頁面
}
}