From 8e6efca7ac556bca73cf4bc4cb1a8985d0652a15 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Mon, 17 Oct 2022 18:49:11 +0200 Subject: [PATCH] [android] fix crash on exit splitscreen Signed-off-by: Arnaud Vergnet --- android/src/com/mapswithme/maps/MwmActivity.java | 1 - .../src/com/mapswithme/maps/maplayer/MapButtonsController.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 6be11490a8..277068fc3a 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1004,7 +1004,6 @@ public class MwmActivity extends BaseMwmFragmentActivity mOnmapDownloader.onResume(); mNavigationController.onActivityResumed(this); - mMapButtonsController.onResume(); mPlacePageController.onActivityResumed(this); refreshLightStatusBar(); } diff --git a/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java b/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java index e83d0e2f18..fda9a4c203 100644 --- a/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java +++ b/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java @@ -187,7 +187,8 @@ public class MapButtonsController extends Fragment public void updateMenuBadge() { final View menuButton = mButtonsMap.get(MapButtons.menu); - final Context context = requireContext(); + final Context context = getContext(); + // Sometimes the global layout listener fires when the fragment is not attached to a context if (menuButton == null || context == null) return; final UpdateInfo info = MapManager.nativeGetUpdateInfo(null);