简体   繁体   English

从最近的应用列表中排除活动

[英]Exclude activity from recent apps list

From widget I want to start an activity to create a checklist, note, or task and then exclude it from recent apps on successful creation.从小部件中,我想启动一项活动以创建清单、注释或任务,然后在成功创建后将其从最近的应用程序中排除。 How do I Exclude an activity from recent apps list(only when I start it from widget?如何从最近的应用程序列表中排除活动(仅当我从小部件启动它时?

I think you should use android:excludeFromRecents="true . Use it in your manifest我认为您应该使用android:excludeFromRecents="true 。在清单中使用它

or或者

Also you can use flag Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS:您也可以使用标志 Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS:

//when you startActivity add this flag
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent);

The activity you start won't be in recent apps.您开始的活动不会出现在最近的应用中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM