android游戏载入的activity跳转到游戏主菜单的activity具体实现
程序员文章站
2023-12-04 21:29:34
复制代码 代码如下: public class loadactivity extends activity { @override protected void oncre...
复制代码 代码如下:
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后由游戏载入页面再跳转到游戏菜单页面
}
}