FragmentNavArgsLazyKt

Added in 1.0.0

public final class FragmentNavArgsLazyKt


Summary

Public methods

static final @NonNull NavArgsLazy<@NonNull Args>
@MainThread
<Args extends NavArgs> navArgs(@NonNull Fragment receiver)

Returns a Lazy delegate to access the Fragment's arguments as an Args instance.

Public methods

@MainThread
public static final @NonNull NavArgsLazy<@NonNull Args> <Args extends NavArgs> navArgs(@NonNull Fragment receiver)

Returns a Lazy delegate to access the Fragment's arguments as an Args instance.

It is strongly recommended that this method only be used when the Fragment is created by androidx.navigation.NavController.navigate with the corresponding androidx.navigation.NavDirections object, which ensures that the required arguments are present.

class MyFragment : Fragment() {
val args: MyFragmentArgs by navArgs()
}

This property can be accessed only after the Fragment's constructor.