android - Home键app重新启动的问题
黄舟
黄舟 2017-04-18 09:05:16
0
4
453

主要出现在小米手机上,在其他手机上暂时没有发现,例入在A页面时,点击home键回到桌面,再次点击app的icon,app重新启动且A页面会销毁,会到A页面之前的页面,在其他手机上别没有发现这个问题,参考网上的答案,但是不能解决

求有经验的大神指点这个问题怎么解决

和这位同学的问题类似
https://segmentfault.com/q/10...

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all (4)
Peter_Zhu

Whether the mobile phone itself has the setting of not retaining activities, you can check it in the developer options first, and then check the related security management software of Xiaomi to compare whether the same situation exists in other software.

    大家讲道理

    Troubleshooting method, first test with other software to see if the same problem will occur. If not, check whether our current interface has destroyed the application in the life cycle method, such as System.exit(0) Let's wait and troubleshoot the problem.

      大家讲道理
      1. If such a weird problem occurs, you should first check if other apps have similar problems. If so, it is a problem with the desktop app, go to 1.1; if not, go to 2;
      1.1. Re-download a desktop application, try again, and analyze where the pitfalls are;
      2. Check the code and XML configuration, especially AndroidManifest.xml, to see if parameters are declared that should not be declared.
        巴扎黑

        This problem should occur during the first installation, right?
        Add the following code to your launchActivity onCreate method:

        /** * 解决APP打包第一次安装之后启动APP图标会出现多个程序的问题 */ if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { finish(); return; }

        Hope this helps you!

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!