简体   繁体   English

从最近的应用列表中清除一项活动后,保持独特的活动

[英]Keep unique activities around after swiping one activity off recent app list

I have two activities in an application I am creating. 我正在创建的应用程序中有两个活动。 I have both activities set up to use their own process. 我将两个活动都设置为使用自己的流程。 The two activities use the singleTask android:launchMode , a unique android:process value, and a unique android:taskAffinity value. 这两个活动使用singleTask android:launchMode ,唯一的android:process值和唯一的android:taskAffinity值。

When I have both activities running, they both show in the recent apps list, and are using unique processes. 当我同时运行两个活动时,它们都显示在最近的应用程序列表中,并且正在使用唯一的流程。

When I swipe either activity, it also kills the process of the other activity. 当我刷任何一个活动时,它也会杀死另一个活动的过程。

Is there a way to prevent this action? 有什么办法可以防止这种情况发生? I want the swipe to remove ONLY the activity I was actually swiping. 我只希望刷卡删除我实际刷卡的活动。

Thank you for any help! 感谢您的任何帮助!

It appears that this is the correct behavior, although undefined officially. 似乎这是正确的行为,尽管尚未正式定义。

Swiping any activity off of the recent apps list will also close any other activities open that are associated with the application. 从最近的应用程序列表中清除任何活动也将关闭与该应用程序关联的所有其他打开的活动。 Services will be kept running, but are notified that the associated activities have been closed. 服务将保持运行状态,但是会通知相关活动已关闭。

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

相关问题 从最近的应用程序列表中滑动活动状态后还能保留活动状态吗? - Preserve activity state after swiping it from recent app list? 从最近的屏幕刷过应用程序后的活动生命周期 - Activity life cycle after swiping the app from recent screen 如何在最近的应用列表中保留同一个应用的多个活动 - how to keep multiple activities of the same app in the recent-apps list 区分Android杀死应用程序和用户在最近的应用程序列表上滑动它 - Differentiate between Android killing the app and user swiping it off on the recent apps list 服务:很少在最近的应用程序列表中将应用程序刷掉而调用onTaskRemoved或onDestroy - Service: onTaskRemoved or onDestroy very rarely being called on swiping app off on the recent apps list 在ListView之后滑动活动 - Swiping activities after ListView 如果应用程序之前未显示最近的应用列表,则应用程序不应在完成活动后显示在最近的应用列表中 - Application should not display in recent app list after finish the activity if app was not displaying recent app list previously 刷掉应用程序后如何保留服务数据 - How to keep data for a service after swiping off the application 手动清除最近的应用程序后,如何使服务运行? - How to make service running even after manually swiping off of recent apps? 从最近的活动开放活动 - Open activity from the recent activities
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM