Clearing Activity Stack

心已入冬 提交于 2019-12-06 19:15:30
Stefan Bossbaly

I found my answer here. Turns out that I have to broadcast an intent to tell all of the Activities to call the method finish().

The documentation for FLAG_ACTIVITY_CLEAR_TOP describes the situation you want if you use it in conjunction with FLAG_ACTIVITY_NEW_TASK

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

"This launch mode can also be used to good effect in conjunction with FLAG_ACTIVITY_NEW_TASK: if used to start the root activity of a task, it will bring any currently running instance of that task to the foreground, and then clear it to its root state. This is especially useful, for example, when launching an activity from the notification manager."

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