SavedStateHandle.Companion



Summary

Extension functions

operator SavedStateHandle
SavedStateHandle.Companion.invoke(
    route: Any,
    typeMap: Map<KTypeNavType<*>>
)

SavedStateHandle constructor to create a SavedStateHandle with a serializable object.

android

Extension functions

operator fun SavedStateHandle.Companion.invoke(
    route: Any,
    typeMap: Map<KTypeNavType<*>> = emptyMap()
): SavedStateHandle

SavedStateHandle constructor to create a SavedStateHandle with a serializable object.

Returns a SavedStateHandle populated with arguments from route.

Note: To use this api in non-instrumented tests, run with robolectric. This is because android's Bundle is necessarily integrated into the parsing of route arguments.

Parameters
route: Any

The route to extract argument values from

typeMap: Map<KTypeNavType<*>> = emptyMap()

A mapping of KType to custom NavType<*> in the route. May be empty if route does not use custom NavTypes.