mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
chore: add guard around getLifecycle
This commit is contained in:
@ -145,8 +145,8 @@ export class Frame extends FrameBase {
|
|||||||
|
|
||||||
// _onAttachedToWindow called from OS again after it was detach
|
// _onAttachedToWindow called from OS again after it was detach
|
||||||
// still happens with androidx.fragment:1.3.2
|
// still happens with androidx.fragment:1.3.2
|
||||||
const activity = androidApplication.foregroundActivity;
|
const activity = androidApplication.foregroundActivity || androidApplication.startActivity;
|
||||||
if ((this._manager && this._manager.isDestroyed()) || !activity.getLifecycle().getCurrentState().isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED)) {
|
if ((this._manager && this._manager.isDestroyed()) || !activity.getLifecycle?.().getCurrentState().isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user