AndroidAutoSize icon indicating copy to clipboard operation
AndroidAutoSize copied to clipboard

集成之后,app进入后台,点击桌面图标,app就会重启,可以确定app没有被杀掉

Open KaiLiDev opened this issue 4 years ago • 3 comments

集成autosize之后,app进入后台,然后点击桌面图标,app就会重新进入启动activity,已经在多个品牌手机上测试都是这种情况(华为小米魅族), app内部没有其他适配相关代码

KaiLiDev avatar Dec 10 '20 03:12 KaiLiDev

是启动页面SplashActivity.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();
                return;
            }
        }

hardlove avatar Dec 11 '21 08:12 hardlove

断点或者使用 adb shell dumpsys activity 命令看下任务栈,看看是怎么启动的

JessYanCoding avatar Dec 14 '21 09:12 JessYanCoding

使用 官方 Demo 或者自己写个 Demo 在对应机型上看看能否重现,如果没有重现,检查下是否是业务代码和框架代码共同导致的这个问题

JessYanCoding avatar Dec 14 '21 09:12 JessYanCoding