只要给Activity设置“android:excludeFromRecents=true”即可,官方的解释如下:
如果设置为true,那么这个Activity将不会出现在最近任务列表中,如果这个Activity是整个Task的根Activity,整个Task将不会出现在最近任务列表中。
这是“android:excludeFromRecents的官方解释:
android:excludeFromRecentsWhether or not the task initiated by this activity should be excluded from the list of recently used applications, the overview screen. That is, when this activity is the root activity of a new task, this attribute determines whether the task should not appear in the list of recent apps. Set "true" if the task should be excluded from the list; set "false" if it should be included. The default value is "false