dudu580231

 

unity 游戏第一次安装完之后运行,切出来,点击桌面图标后黑屏问题

这个问题只会在第一次出现,之后就是桌面进入了,不会再出现这个问题了

 

 

这是一个解决办法吧:

就是将安装之后运行的游戏杀死,然后在重新进入游戏,

 

 

 // 在onCreate()最前面添加一下代码

if (!isTaskRoot()) {
    final Intent intent = getIntent();
    final String intentAction = intent.getAction();
    if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) &&
            intentAction != null && intentAction.equals(Intent.ACTION_MAIN)) {
        finish();
    }
}

 

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2021-09-27
  • 2021-10-06
  • 2021-10-16
  • 2021-06-06
  • 2021-11-30
  • 2022-01-01
猜你喜欢
  • 2021-11-03
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
相关资源
相似解决方案