[英]How do I prevent the back button from exiting my app if it was launched from recent apps screen?
When I launch my activity from the recent apps menu (using a long click on the home screen) and then hit the back button (once the app is launched), the app exits and returns to the home screen.当我从最近的应用程序菜单启动我的活动(在主屏幕上长按)然后点击返回按钮(一旦应用程序启动),应用程序退出并返回到主屏幕。 The behavior I would have expected is that the entire application activity stack is reloaded, so hitting back would finish the current activity and go down one level in the stack inside my application.
我所期望的行为是重新加载整个应用程序活动堆栈,因此回击将完成当前活动,并且 go 在我的应用程序内的堆栈中下降一级。
What am I doing wrong?我究竟做错了什么? Is there a setting in my AndroidManifest.xml that I should keep an eye out for?
我的 AndroidManifest.xml 中是否有我应该留意的设置?
Thanks in advance.提前致谢。
Bringing back the whole task stack should be the default behavior.带回整个任务堆栈应该是默认行为。 Do you call finish() on your activities or set nohistory in manifest?
您是否在活动中调用完成()或在清单中设置 nohistory ? If so, that explains it.
如果是这样,那就解释了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.