[英]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.