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