android游戏载入的activity跳转到游戏主菜单的activity具体实现
作者:
停止2s后由游戏载入页面再跳转到游戏菜单页面,具体实现代码如下,感兴趣的朋友可以参考下哈
复制代码 代码如下:
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后由游戏载入页面再跳转到游戏菜单页面
}
}