主要出现在小米手机上,在其他手机上暂时没有发现,例入在A页面时,点击home键回到桌面,再次点击app的icon,app重新启动且A页面会销毁,会到A页面之前的页面,在其他手机上别没有发现这个问题,参考网上的答案,但是不能解决
求有经验的大神指点这个问题怎么解决
和这位同学的问题类似
https://segmentfault.com/q/10...
天蓬老师2017-04-18 09:07:16
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.
大家讲道理2017-04-18 09:07:16
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.
大家讲道理2017-04-18 09:07:16
巴扎黑2017-04-18 09:07:16
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!