当前位置: 编程技术>移动开发
android游戏载入的activity跳转到游戏主菜单的activity具体实现
来源: 互联网 发布时间:2014-10-17
本文导语: 代码如下: 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, WindowMan...
代码如下:
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后由游戏载入页面再跳转到游戏菜单页面
}
}