首页 > 系统 > Android > 正文

android游戏载入的activity跳转到游戏主菜单的activity具体实现

2020-04-11 12:17:08
字体:
来源:转载
供稿:网友
复制代码 代码如下:

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后由游戏载入页面再跳转到游戏菜单页面
}
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表