From dcf1dc33b1ed350c422b90f9fbc6e7a821020056 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:52:03 +0000 Subject: [PATCH] fix(home): open drawer apps in their own task --- app/src/main/java/com/droiddeck/launcher/HomeApp.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/HomeApp.kt b/app/src/main/java/com/droiddeck/launcher/HomeApp.kt index f71ca928a8..7def297543 100644 --- a/app/src/main/java/com/droiddeck/launcher/HomeApp.kt +++ b/app/src/main/java/com/droiddeck/launcher/HomeApp.kt @@ -97,13 +97,14 @@ object HomeApp { val intent = Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_LAUNCHER) .setComponent(ComponentName(app.packageName, app.className)) + // Keep the target app's task separate from DroidDeck. Without this, Android puts the app on + // top of the caller's task: swiping it out of Recents then removes DroidDeck's task and + // ends the session, and on another display the entire task moves there. + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) if (displayId == null) { context.startActivity(intent) return } - // Keep the target app's task separate from DroidDeck. Without this, Android can put the - // app on top of the caller's task and move the entire task to the chosen display. - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) val options = ActivityOptions.makeBasic().setLaunchDisplayId(displayId) context.startActivity(intent, options.toBundle()) }