简体   繁体   English

活动会从最近的应用列表中删除该应用

[英]An Activity removes the app from recent apps list

I'm developing a SDK with a single Activity that's started with the following flags: 我正在开发一个带有单个Activity的SDK,它以以下标志开头:

FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_SINGLE_TOP | FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS

Everything works as expected (ie there's a single instance of the Activity that receives all Intents; the user can't navigate back to it) except for one case. 一切都按预期工作(即,除了一个案例之外,有一个活动的单个实例接收所有Intents;用户无法导航回它)。
If I start the Activity & then finish the one that started it, the app disappears from the recent apps list. 如果我启动Activity然后完成启动它的那个,则应用程序将从最近的应用列表中消失。
How do I prevent that from happening? 我该如何防止这种情况发生?

Becuase of this flag its not appearing. 因为这个标志没有出现。

FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS

Remove it and try.. 删除它并尝试..

if you mentioned above flag then The App will not shown in the recent Apps list.. 如果你提到上面的标志然后该应用程序将不会显示在最近的应用程序列表中..

指定android:taskAffinity="org.example.app"解决了这个问题。

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

相关问题 当应用程序从android中的最新应用程序列表中删除时,服务停止 - Service stopped when the app removes from recent apps list in android Android-从操作系统的应用程序“最近使用的应用程序”列表中启动的活动 - Android - Activity launched from the OS's app recent apps list 当用户从最近的应用程序列表中删除应用程序时,如何取消警报管理器警报? - How to cancel alarm manager alarms when user removes the app from recent apps list? 从最近的应用列表中排除活动 - Exclude activity from recent apps list 如何在完成时从最近的应用列表中删除活动? - How to remove activity from recent apps list on finish? 从窗口小部件启动时,活动未显示在最近的应用列表中 - 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 即使在用户从最近的应用程序中删除应用程序后,如何安排和发送通知? - How To schedule and a send Notification even after user removes app from recent apps? Android:如何检测从最近的应用列表中杀死的应用? - Android : How to detect app killed from recent apps list? 从最近的应用列表中删除应用时,请避免取消通知 - Avoid cancelation of Notification on removing app from recent apps list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM