resume

@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
abstract fun resume(navigationResumeSnapshot: NavigationResumeSnapshot)

Restores the navigation session with a given NavigationResumeSnapshot.

To retrieve and save the NavigationResumeSnapshot for the ongoing navigation session, see TomTomNavigation.navigationResumeSnapshot.

To resume a previously saved navigation session, you can use the following snippet:

val fileName = "navigation_snapshot"
val file = File(context.filesDir, fileName)
if (file.exists()) {
NavigationResumeSnapshot.deserializeFromFile(file) //Or NavigationResumeSnapshot.deserializeFromBytes(bytes)
.ifSuccess { snapshot ->
tomTomNavigation.resume(navigationResumeSnapshot = snapshot)
}
.ifFailure { failure: NavigationResumeSnapshotSerializationFailure ->
println("An error occurred: $failure")
}
}

As a result of successful action, the following listeners are notified:

Parameters

navigationResumeSnapshot

The data necessary to resume the navigation session.

Throws

if the vehicle used for navigation is incompatible with the given RoutePlan from the NavigationResumeSnapshot.