WaypointArrivalListener
Informs the caller about waypoint arrival state changes during navigation.
The waypoint arrival state changes are detected by the ArrivalDetectionEngine. When notified, the listener can indicate two different states of waypoint arrival experience:
onWaypointArrived which informs that the ArrivalDetectionEngine detected an arrival at a waypoint.
onWaypointDeparted which informs that the ArrivalDetectionEngine detected a departure from a waypoint.
To listen to waypoint arrival state changes while navigating, first implement this interface to create a listener, for example:
val waypointArrivalListener = object : WaypointArrivalListener {
override fun onWaypointArrived(waypoint: RouteStop, route: Route) {
// add code here that handles the waypoint arrival
}
override fun onWaypointDeparted(waypoint: RouteStop, route: Route) {
// add code here that handles the waypoint departure
}
}
Then add this listener using TomTomNavigation.addWaypointArrivalListener.
To stop listening to the waypoint arrival state changes, remove the listener using TomTomNavigation.removeWaypointArrivalListener.