resume

abstract fun resume(navigationResumeSnapshot: NavigationResumeSnapshot)

Restores the navigation session with a given NavigationResumeSnapshot.

Important: This is a Public Preview API. It may be changed or removed at any time.

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()) {
val data = file.readText()
NavigationResumeSnapshot.deserialize(data)
.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 navigation session is already started.