FragmentNavArgsLazyKt

public final class FragmentNavArgsLazyKt


Summary

Public methods

static final @MainThread @NonNull NavArgsLazy<@NonNull Args>

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

Public methods

FragmentNavArgsLazyKt.navArgs

@MainThread
@NonNull
public static final @MainThread NavArgsLazy<@NonNull Args> <Args extends NavArgs> FragmentNavArgsLazyKt.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.