diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt index 39399a66744f..a7aadc4e149c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt @@ -311,6 +311,15 @@ public class ReactHostImpl( val method = "onHostDestroy(activity)" log(method) + // Mirror the multi-activity awareness from onHostPause: don't destroy the shared + // ReactContext while other activities are still active. + if (activity != null) { + activeActivities.remove(activity) + if (activeActivities.size > 0) { + return + } + } + val currentActivity = this.currentActivity if (currentActivity === activity) {