开发者

How do I prevent the back button from exiting my app if it was launched from recent apps screen?

开发者 https://www.devze.com 2023-03-02 18:03 出处:网络
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 b

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.

What am I doing wrong? Is ther开发者_StackOverflowe a setting in my AndroidManifest.xml that I should keep an eye out for?

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? If so, that explains it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号