diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 7e619997d5..ab19783a63 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -516,6 +516,7 @@ public class MwmActivity extends BaseMwmFragmentActivity mSearchController = new FloatingSearchToolbarController(this, this); mSearchController.getToolbar().getViewTreeObserver().addOnGlobalLayoutListener(new ToolbarLayoutChangeListener()); mSearchController.setVisibilityListener(this); + SearchEngine.INSTANCE.addListener(this); SharingHelper.INSTANCE.initialize(); @@ -1336,7 +1337,6 @@ public class MwmActivity extends BaseMwmFragmentActivity protected void onStart() { super.onStart(); - SearchEngine.INSTANCE.addListener(this); Framework.nativeSetMapObjectListener(this); BookmarkManager.INSTANCE.addLoadingListener(this); BookmarkManager.INSTANCE.addCatalogListener(this); @@ -1351,7 +1351,6 @@ public class MwmActivity extends BaseMwmFragmentActivity protected void onStop() { super.onStop(); - SearchEngine.INSTANCE.removeListener(this); Framework.nativeRemoveMapObjectListener(); BookmarkManager.INSTANCE.removeLoadingListener(this); BookmarkManager.INSTANCE.removeCatalogListener(this); @@ -1377,6 +1376,7 @@ public class MwmActivity extends BaseMwmFragmentActivity mToggleMapLayerController.detachCore(); TrafficManager.INSTANCE.detachAll(); mPlacePageController.destroy(); + SearchEngine.INSTANCE.removeListener(this); } @Override