SavedStateHandleKt

Added in 2.8.0

public final class SavedStateHandleKt


Summary

Public methods

static final @NonNull T
<T extends Object> toRoute(
    @NonNull SavedStateHandle receiver,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)

Returns route as an object of type T

static final @NonNull T
<T extends Object> toRoute(
    @NonNull SavedStateHandle receiver,
    @NonNull KClass<@NonNull T> route,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)

Returns route as an object of type T

Public methods

public static final @NonNull T <T extends Object> toRoute(
    @NonNull SavedStateHandle receiver,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)

Returns route as an object of type T

Extrapolates arguments from SavedStateHandle and recreates object T

Parameters
<T extends Object>

the entry's NavDestination.route as a KClass

@NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap

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

Returns
@NonNull T

A new instance of this entry's NavDestination.route as an object of type T

public static final @NonNull T <T extends Object> toRoute(
    @NonNull SavedStateHandle receiver,
    @NonNull KClass<@NonNull T> route,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)

Returns route as an object of type T

Extrapolates arguments from SavedStateHandle and recreates object T

Parameters
@NonNull KClass<@NonNull T> route

the entry's NavDestination.route as a KClass

@NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap

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

Returns
@NonNull T

A new instance of this entry's NavDestination.route as an object of type T

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 18, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 20, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 18, 2024