fix: handle fake attach after FragMgr is destroyed (#8200)

This commit is contained in:
Alexander Vakrilov
2019-12-17 08:57:30 +02:00
committed by GitHub
parent 76442f433e
commit d1858f81b7
2 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -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();
}