setActiveRoutePlan
Sets a provided routePlan as active. As a result of calling the method with a null argument, the navigation session transitions from NavigationState.ActiveGuidance to NavigationState.FreeDriving.
Note: If the navigation is in NavigationState.FreeDriving state and the method will be called with null argument, it will have no effect.
Note: This method is exclusively callable after navigation has already started. Use this method to manually update the active route during the navigation session. If the method is called before navigation has started, it will have no effect.
If the navigation has been successfully started with an active route plan, then this method replaces the current active route with the provided one. The navigation session continues with the new route plan.
If the navigation has been started without an active route plan, then the navigation session continues with the provided routePlan. The navigation session transitions from NavigationState.FreeDriving to NavigationState.ActiveGuidance state.
Note: To keep navigation guidance consistent, ensure that before calling this method, the provided routePlan does not contain the DepartureInstruction as the first instruction; this instruction solely indicates the start of navigation.
As a result of successfully invoking this method with a non-null routePlan, the following listeners are notified:
RouteAddedListener, with the Route and RoutePlanningOptions set in routePlan, and RouteAddedReason.ManuallyUpdated.
ActiveRouteChangedListener, with the Route set in routePlan.
As a result of successfully invoking this method with a non-null routePlan, the following listeners may be notified:
NavigationStateChangedListener, with the state set to NavigationState.ActiveGuidance, if navigation is currently in the NavigationState.FreeDriving state.
RouteRemovedListener, with the previously active Route and RouteRemovedReason.Manual, if navigation has already been actively navigating a route.
As a result of successfully invoking this method with a null argument, the following listeners are notified:
RouteRemovedListener, with the previously active and proposed Route and RouteRemovedReason.Manual, if navigation has already been actively navigating a route.
NavigationStateChangedListener, with the state set to NavigationState.FreeDriving, if navigation is currently in the NavigationState.ActiveGuidance state.
Note that the initial instances of navigation engines are used in the new navigation session.
Parameters
A route plan to be set as active.
Throws
if the vehicle used for navigation is incompatible with the given route plan.