Android - nuke the previous app history

别说谁变了你拦得住时间么 提交于 2019-12-12 03:39:36

问题


Here's scenario. Say I have an app that I was using and navigated from activity to activity so now there's some history there. Then I switched to another app so my first one is on the background. If I return to it I would be able to click "Back" to navigate the history and traverse 1st app steps. Now imagine that I also have a notification that when clicked will bring one of the activities of the first app. Currently when that happens and I hit "Back" I will return to the previous history stack. My requirement - if I call activity using notification then I should have no history, If I hit back, the app should simply exit. Is is doable and how? This is related to my other former question which in the retrospect didn't really got the answer


回答1:


Try looking up the various launch modes such as FLAG_ACTIVITY_CLEAR_TOP



来源:https://stackoverflow.com/questions/3973092/android-nuke-the-previous-app-history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!