简体   繁体   English

再次关于按“主页”按钮并从上一个活动恢复

[英]Again about pressing Home button and resuming from last activity

I saw a lot of topics, but no normal solution to my problem. 我看到了很多主题,但是没有解决我问题的常规方法。 I have 2 activities A and B. The sequence is: A->B->Home->Launch again->A In documentation it's said that whole stack will go to foreground. 我有2个活动A和B。顺序为:A-> B-> Home->再次启动-> A在文档中,据说整个堆栈都将进入前台。 And it actually goes, but it also launches A again, so the stack now is: AB A. I tried to make A "singleTask" hoping that when I press the button system will find A already running and my stack will appear on the screen. 它确实运行了,但是它也再次启动了A,所以堆栈现在是:ABA。我试图制作一个“ singleTask”,希望当我按下按钮时系统会发现A已经在运行并且我的堆栈会出现在屏幕上。 And system finds my A, but now it clear the stack and it look like: A. I ran out of ideas... 系统找到了我的A,但是现在它清除了堆栈,看起来像:A.我用尽了主意...

The problem was caused by running app using Intellij IDEA. 该问题是由使用Intellij IDEA运行应用程序引起的。 When I run it manually, stack works as expected. 当我手动运行它时,堆栈按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM