HandleResultOrNull

fun <T : Any> NavHostController.HandleResultOrNull(type: NavigationBundleSpecType<T>, retain: Boolean = false, onResult: T?.() -> Unit)

Handles a Route.Result.Data matching a given NavigationBundleSpecType Requires that Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType either directly or wrapped in NavigationBundleSpecType.OptionalType

Parameters

T

the type of the result.

type

The NavigationBundleSpecType stored in the result

retain

If true the result will be retained in the NavBackStackEntry. It will be deleted otherwise.

onResult

Method for handling the received result


@JvmName(name = "HandleNullableResultOrNull")
fun <T> NavHostController.HandleResultOrNull(type: NavigationBundleSpecType<T>, retain: Boolean = false, onResult: T?.() -> Unit)

Handles a Route.Result.Data matching a given NavigationBundleSpecType Requires that Route.Result.Data.bundle is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType

Parameters

T

the type of the result.

type

The NavigationBundleSpecType stored in the result

retain

If true the result will be retained in the NavBackStackEntry. It will be deleted otherwise.

onResult

Method for handling the received result