parseTypeOfOrNull

fun <T : Any> Activity.parseTypeOfOrNull(serializer: KSerializer<T>): T?
@JvmName(name = "parseNullableTypeOfOrNull")
fun <T> Activity.parseTypeOfOrNull(serializer: KSerializer<T>): T?

Parses the Bundle of android.app.Activity.getIntent into T if is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType.SerializedType with serializer either directly or wrapped by NavigationBundleSpecType.OptionalType.

Return

The T stored in the bundle or null if no such value was found.

Parameters

serializer

The KSerializer to deserialize T from the bundle.


fun <T : Any> Fragment.parseTypeOfOrNull(serializer: KSerializer<T>): T?
@JvmName(name = "parseNullableTypeOfOrNull")
fun <T> Fragment.parseTypeOfOrNull(serializer: KSerializer<T>): T?

Parses the Bundle of androidx.fragment.app.Fragment.getArguments into T if is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType.SerializedType with serializer either directly or wrapped by NavigationBundleSpecType.OptionalType.

Return

The T stored in the bundle or null if no such value was found.

Parameters

serializer

The KSerializer to deserialize T from the bundle.


fun <T : Any> Intent?.parseTypeOfOrNull(serializer: KSerializer<T>): T?
@JvmName(name = "parseNullableTypeOfOrNull")
fun <T> Intent?.parseTypeOfOrNull(serializer: KSerializer<T>): T?

Parses the Bundle of Intent into T if is described by a SingleValueNavigationSpec matching the NavigationBundleSpecType.SerializedType with serializer either directly or wrapped by NavigationBundleSpecType.OptionalType.

Return

The T stored in the bundle or null if no such value was found.

Parameters

serializer

The KSerializer to deserialize T from the bundle.