From 127ea530911dc9eec940f493e3071ed23ee2325c Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Sun, 28 Jan 2024 20:46:54 +0100 Subject: [PATCH] better check --- .../java/org/appcelerator/titanium/TiApplication.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java b/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java index 4c4bf105912..b97da5a8255 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java @@ -198,10 +198,11 @@ public static void removeFromActivityStack(Activity activity) { if (activity != null) { activityStack.remove(activity); - if (activityStack.size() == 1 && activityStack.get(0).get() - .getLocalClassName().equals(TiApplication.getAppRootOrCurrentActivity().getLocalClassName())) { - // only base activity is visible - close app - terminateActivityStack(); + if (activityStack.size() == 1) { + boolean isTiRootActivity = (activityStack.get(0).get() instanceof TiRootActivity); + if (isTiRootActivity) { + terminateActivityStack(); + } } } }