diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 083494f65..4f6801520 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -145,6 +145,7 @@ public class MainActivity extends CastEnabledActivity { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } drawerLayout = null; + bottomNavigation.onCreateView(); } else { bottomNavigation.hide(); bottomNavigation = null; @@ -337,7 +338,7 @@ public class MainActivity extends CastEnabledActivity { drawerLayout.removeDrawerListener(drawerToggle); } if (bottomNavigation != null) { - bottomNavigation.onDestroy(); + bottomNavigation.onDestroyView(); } } @@ -571,9 +572,6 @@ public class MainActivity extends CastEnabledActivity { super.onStart(); EventBus.getDefault().register(this); new RatingDialogManager(this).showIfNeeded(); - if (bottomNavigation != null) { - bottomNavigation.onStart(); - } getOnBackPressedDispatcher().addCallback(this, openDefaultPageBackPressedCallback); getOnBackPressedDispatcher().addCallback(this, bottomSheetBackPressedCallback); } @@ -603,9 +601,6 @@ public class MainActivity extends CastEnabledActivity { protected void onStop() { super.onStop(); EventBus.getDefault().unregister(this); - if (bottomNavigation != null) { - bottomNavigation.onStop(); - } } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/drawer/BottomNavigation.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/drawer/BottomNavigation.java index e1443ee1a..84a723738 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/screen/drawer/BottomNavigation.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/drawer/BottomNavigation.java @@ -148,15 +148,12 @@ public class BottomNavigation { bottomNavigationView.setVisibility(View.GONE); } - public void onStart() { + public void onCreateView() { EventBus.getDefault().register(this); } - public void onStop() { + public void onDestroyView() { EventBus.getDefault().unregister(this); - } - - public void onDestroy() { if (bottomNavigationBadgeLoader != null) { bottomNavigationBadgeLoader.dispose(); bottomNavigationBadgeLoader = null;