简体   繁体   English

按主页,然后回到应用程序并按返回按钮,退出应用程序

[英]press home, then back to app and press back button,it exits the app

I have android:launchMode="singleInstance" in the manifest file.我在清单文件中有android:launchMode="singleInstance"

I am using google maps and on pressing the overlay -it opens a new intent.If I press back it comes back to the previous activity .我正在使用谷歌地图并按下叠加层 - 它会打开一个新的意图。如果我按下回它会返回到之前的activity

But if I press home button and Hold Home button for few seconds and go back to my app and press back button it exits the app.但是,如果我按下主页按钮并按住主页按钮几秒钟,然后 go 回到我的应用程序并按下返回按钮,它会退出应用程序。

Summarizing -> GoogleMapsActivity -> DisplayActivity总结 -> GoogleMapsActivity -> DisplayActivity

here GoogleMapsActivity has android:launchMode="singleInstance" in manifest file.hence I cannot go back to it.这里GoogleMapsActivity在清单文件中有android:launchMode="singleInstance" 。因此我不能 go 返回它。

Is there any possibility to send it to GoogleMapsActivity when home button is pressed ,hence the activity would still exist.是否有可能在按下主页按钮时将其发送到GoogleMapsActivity ,因此活动仍然存在。 Or any other way to resolve the problem.或任何其他解决问题的方法。

Check the official documentation at: Manifest element and look at android:allowTaskReparenting and android:launchMode sections.查看官方文档: 清单元素并查看android:allowTaskReparentingandroid:launchMode部分。

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

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