setActiveRoutePlan
Sets a provided routePlan as active.
Note: This method is exclusively callable after navigation has been already started. Use this method to manually update the active route during the navigation session. If the method is called before navigation has been 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 successful action, 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 successful action, the following listeners may be notified:
NavigationStateChangedListener, with the state set to NavigationState.ActiveGuidance, if navigation is currently in NavigationState.FreeDriving state.
RouteRemovedListener, with the previously active Route and RouteRemovedReason.Manual, if navigation has already been actively navigating a route.
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.