RouteRemovedListener
Informs the caller that the active or proposed route has been removed from the navigation session.
The active route is removed from the session 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.
To listen to the route being removed from the session, first implement this interface to create a listener, for example:
val routeRemovedListener = RouteRemovedListener { route, reason ->
// add code here that handles the route being removed from the session
}
Then 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.