Android的 - 核弹previous应用历史记录 [英] Android - nuke the previous app history
问题描述
下面的场景。说我有,我用一个应用程序,并从活动导航到活动所以现在有一些历史上。然后我切换到另一个应用程序,所以我第一个上的背景。如果我回到它,我就可以点击返回浏览历史和遍历1应用步骤。
现在想象一下,我也有一个通知,点击时会带来第一个应用程序的活动之一。目前,这种情况发生时,我点击返回我将回到previous历史堆栈。我的要求 - 如果我打电话通知用那么我应该是没有历史的,如果我打回,应用程序应该简单地离开活动。是是可行的,如何?
这关系到我的<一个href=\"http://stackoverflow.com/questions/3473168/clear-the-entire-history-stack-and-start-a-new-activity-on-android\">other前一个问题这在事后并没有真正得到了答案
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
推荐答案
尝试找寻不同的启动模式,如的 FLAG_ACTIVITY_CLEAR_TOP
Try looking up the various launch modes such as FLAG_ACTIVITY_CLEAR_TOP
这篇关于Android的 - 核弹previous应用历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!