RouteRemovedListener
Used to inform the caller that a route has been removed from the navigation session.
The removed route could have been either the previously active route, which has been replaced with a new one, or a proposed route.
The previously active route is replaced with a new one when:
The navigation has completed replanning and set the new replanned route as the active one.
The active route plan is updated using the TomTomNavigation.setActiveRoutePlan or TomTomNavigation.selectActiveRoute method. Note that if the TomTomNavigation.setActiveRoutePlan is called with the same route as the currently active one, this listener will not be triggered.
The user is not following the active route as reported by RouteTrackingStateUpdatedListener.
The proposed route is removed from the session when:
The user is not following the route, as reported by RouteTrackingStateUpdatedListener resulting in the proposed route being placed in the RouteTrackingState.unfollowedRoutes list.
The navigation has finished planning a new route due to replanning initiated by the navigation.
The active route plan is updated using the TomTomNavigation.setActiveRoutePlan method. Note that if the TomTomNavigation.setActiveRoutePlan is called with the same route as the proposed one, this listener will not be triggered.
In order to listen to the route being removed from the session, implement this interface to create a listener, for instance:
val routeRemovedListener = RouteRemovedListener { route, reason ->
// Implement the necessary functionality for handling the route being removed from the session
}
Subsequently, add this listener using TomTomNavigation.addRouteRemovedListener. To stop listening to the route being removed from the session, remove the listener using TomTomNavigation.removeRouteRemovedListener.
The complementary listener that provides updates on the addition of routes to the session is RouteAddedListener. Note, during navigation in the turn by turn mode there will always be one active route. Therefore, any removal of the current active route will always be preceded by an ActiveRouteChangedListener call, with details of the new active route.