简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM