diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 67fee8f890..a4e28e8c25 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -961,6 +961,10 @@ public class MwmActivity extends BaseMwmFragmentActivity if (!isChangingConfigurations()) RoutingController.get().saveRoute(); + else + // We no longer need in a saved route if it's a configuration changing: theme switching, + // orientation changing, etc. Otherwise, the saved route might be restored at undesirable moment. + RoutingController.get().deleteSavedRoute(); super.onSaveInstanceState(outState); } diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 796e797fe5..71da87ebc7 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -376,6 +376,11 @@ public class RoutingController implements TaxiManager.TaxiListener Framework.nativeSaveRoutePoints(); } + public void deleteSavedRoute() + { + Framework.nativeDeleteSavedRoutePoints(); + } + public void prepare(boolean canUseMyPositionAsStart, @Nullable MapObject endPoint) { prepare(canUseMyPositionAsStart, endPoint, false);