File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -399,8 +399,9 @@ export class BottomNavigation extends TabNavigationBase {
399399 super . _onAttachedToWindow ( ) ;
400400
401401 // _onAttachedToWindow called from OS again after it was detach
402- // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
403- if ( this . _manager && this . _manager . isDestroyed ( ) ) {
402+ // still happens with androidx.fragment:1.3.2
403+ const activity = Application . android . foregroundActivity ;
404+ if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
404405 return ;
405406 }
406407
Original file line number Diff line number Diff line change @@ -499,8 +499,9 @@ export class Tabs extends TabsBase {
499499 super . _onAttachedToWindow ( ) ;
500500
501501 // _onAttachedToWindow called from OS again after it was detach
502- // TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
503- if ( this . _manager && this . _manager . isDestroyed ( ) ) {
502+ // still happens with androidx.fragment:1.3.2
503+ const activity = Application . android . foregroundActivity ;
504+ if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
504505 return ;
505506 }
506507
You can’t perform that action at this time.
0 commit comments