简体   繁体   English

Android-从操作系统的应用程序“最近使用的应用程序”列表中启动的活动

[英]Android - Activity launched from the OS's app recent apps list

When the app is started from the OS's recent list, is there a way to ensure the normal launching activity actually starts or set the launching activity in the Manifest, or even prevent the app from OS launching from history? 从操作系统的最新列表启动该应用程序时,是否有办法确保正常的启动活动实际上已启动或在清单中设置了启动活动,甚至阻止该应用程序从历史记录中启动?

ie

<category android:name="android.intent.category.(HISTORY)" />

I have an app where the state has to be set through a specific activity sequence so I'd like to ensure this without testing and calling finish() and startActivity() in onCreate() methods. 我有一个应用程序,必须通过特定的活动序列设置状态,因此我想确保这一点而无需测试并在onCreate()方法中调用finish()和startActivity()。

If you are talking about recent apps, you can use android:excludeFromRecents=["true" | 如果您正在谈论最近的应用程序,则可以使用android:excludeFromRecents = [“ true” | "false"] “假”]

"Whether or not the task initiated by this activity should be excluded from the list of recently used applications ("recent apps"). 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. "true" if the task should be excluded from the list; "false" if it should be included. The default value is "false". " “是否应将此活动启动的任务从最近使用的应用程序(“最近的应用程序”)列表中排除。也就是说,当此活动是新任务的根活动时,此属性确定该任务是否不应出现在最近使用的应用程序列表中。如果应从列表中排除该任务,则为“ true”;如果应包括该任务,则为“ false”。默认值为“ false”。“

Ref: http://developer.android.com/guide/topics/manifest/activity-element.html 参考: http : //developer.android.com/guide/topics/manifest/activity-element.html

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

相关问题 从窗口小部件启动时,活动未显示在最近的应用列表中 - Activity not showing in list of recent apps when launched from a widget 从NFC启动的活动/应用程序永远不会出现在最近的应用程序列表中 - Activity/Application Launched From NFC Never Appears in Recent Apps List 从SEND Intent启动后,Android应用在“最新应用”列表中的行为有所不同 - Android app behaves differently in “recent apps” list when launched from SEND Intent 活动会从最近的应用列表中删除该应用 - An Activity removes the app from recent apps list 启动器活动未从最近的应用程序启动 - Launcher Activity not launched from recent Apps 从通知启动应用程序时如何重新创建最近的应用程序活动 - How to recreate recent-apps activity when app is launched from notification 如何在最近的应用程序列表中显示我的应用程序和浏览器是作为意图启动的? - How to show my app and browser launched as an intent in the recent apps list? Android的最新应用列表重定向到另一个应用 - Android's recent apps list redirecting to another app 从最近的应用列表中排除活动 - Exclude activity from recent apps list Android:如何检测从最近的应用列表中杀死的应用? - Android : How to detect app killed from recent apps list?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM