LaneGuidanceUpdatedListener
Used to inform the caller that the lane guidance information has been updated. This interface provides listeners for when lane guidance starts and ends.
The LaneGuidanceUpdatedListener interface provides the methods that are called when lane guidance shall appear and disappear, respectively. These methods facilitate efficient and dynamic update of lane guidance information during a journey.
Note: To ensure these methods are called, the Route passed to TomTomNavigation must contain valid LaneSections. This code is used within the context of a navigation system where lane guidance is crucial for the user experience and journey accuracy. LaneSections can be enabled in the GuidanceOptions object, by setting the GuidanceOptions.extendedSections property to true.
In order to listen to the lane guidance updates, implement this interface to create a listener, for instance:
val laneGuidanceUpdatedListener = LaneGuidanceUpdatedListener {
override fun onLaneGuidanceStarted(laneGuidance: LaneGuidance) {
// Implement the necessary functionality for handling the lane guidance starting
}
override fun onLaneGuidanceEnded(laneGuidance: LaneGuidance) {
// Implement the necessary functionality for handling the lane guidance ending
}
}
Subsequently, add this listener using TomTomNavigation.addLaneGuidanceUpdatedListener. To stop listening to the lane guidance updates, remove the listener using TomTomNavigation.removeLaneGuidanceUpdatedListener.