WaypointArrivalListener
interface WaypointArrivalListener
Notifies the caller of changes to the WaypointState during navigation.
The WaypointState 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 the WaypointState 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
}
}
Content copied to clipboard
Then add this listener using TomTomNavigation.addWaypointArrivalListener.
To stop listening to the WaypointState changes, remove the listener using TomTomNavigation.removeWaypointArrivalListener.