From d1858f81b7e2e8df78cd466f8a74807ceddbeb54 Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Tue, 17 Dec 2019 08:57:30 +0200 Subject: [PATCH] fix: handle fake attach after FragMgr is destroyed (#8200) --- .../ui/bottom-navigation/bottom-navigation.android.ts | 4 ++-- nativescript-core/ui/frame/frame.android.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts index 077a4096c..0f253dfa1 100644 --- a/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts +++ b/nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts @@ -385,14 +385,14 @@ export class BottomNavigation extends TabNavigationBase { _onAttachedToWindow(): void { super._onAttachedToWindow(); - this._attachedToWindow = true; // _onAttachedToWindow called from OS again after it was detach // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0 if (this._manager && this._manager.isDestroyed()) { return; } - + + this._attachedToWindow = true; this.changeTab(this.selectedIndex); } diff --git a/nativescript-core/ui/frame/frame.android.ts b/nativescript-core/ui/frame/frame.android.ts index e06248e64..286575b3c 100644 --- a/nativescript-core/ui/frame/frame.android.ts +++ b/nativescript-core/ui/frame/frame.android.ts @@ -150,14 +150,14 @@ export class Frame extends FrameBase { _onAttachedToWindow(): void { super._onAttachedToWindow(); - this._attachedToWindow = true; - + // _onAttachedToWindow called from OS again after it was detach // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0 if (this._manager && this._manager.isDestroyed()) { return; } - + + this._attachedToWindow = true; this._processNextNavigationEntry(); }