diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index 200083ea8..177d2b4c5 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -144,8 +144,8 @@ export class Frame extends FrameBase { // _onAttachedToWindow called from OS again after it was detach // still happens with androidx.fragment:1.3.2 - const activity = androidApplication.foregroundActivity || androidApplication.startActivity; - if ((this._manager && this._manager.isDestroyed()) || !activity.getLifecycle?.().getCurrentState().isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED)) { + const lifecycleState = (androidApplication.foregroundActivity?.getLifecycle?.() || androidApplication.startActivity?.getLifecycle?.())?.getCurrentState() || androidx.lifecycle.Lifecycle.State.CREATED; + if ((this._manager && this._manager.isDestroyed()) || !lifecycleState.isAtLeast(androidx.lifecycle.Lifecycle.State.CREATED)) { return; }