FragmentTransactionKt

public final class FragmentTransactionKt


Summary

Public methods

static final @NonNull FragmentTransaction
<F extends Fragment> FragmentTransactionKt.add(
    @NonNull FragmentTransaction receiver,
    @IdRes int containerViewId,
    @Nullable String tag,
    @Nullable Bundle args
)

Add a fragment to the associated FragmentManager, inflating the Fragment's view into the container view specified by containerViewId, to later retrieve via FragmentManager.findFragmentById.

static final @NonNull FragmentTransaction
<F extends Fragment> FragmentTransactionKt.add(
    @NonNull FragmentTransaction receiver,
    @NonNull String tag,
    @Nullable Bundle args
)

Add a fragment to the associated FragmentManager without adding the Fragment to any container view.

static final @NonNull FragmentTransaction
<F extends Fragment> FragmentTransactionKt.replace(
    @NonNull FragmentTransaction receiver,
    @IdRes int containerViewId,
    @Nullable String tag,
    @Nullable Bundle args
)

Replace an existing fragment that was added to a container.

Public methods

FragmentTransactionKt.add

@NonNull
public static final FragmentTransaction <F extends Fragment> FragmentTransactionKt.add(
    @NonNull FragmentTransaction receiver,
    @IdRes int containerViewId,
    @Nullable String tag,
    @Nullable Bundle args
)

Add a fragment to the associated FragmentManager, inflating the Fragment's view into the container view specified by containerViewId, to later retrieve via FragmentManager.findFragmentById.

The new fragment to be added will be created via the FragmentFactory of the FragmentManager.

Parameters
@IdRes int containerViewId

Identifier of the container this fragment is to be placed in.

@Nullable String tag

Optional tag name for the fragment, to later retrieve the fragment with FragmentManager.findFragmentByTag.

@Nullable Bundle args

Optional arguments to be set on the fragment.

Returns
FragmentTransaction

Returns the same FragmentTransaction instance.

FragmentTransactionKt.add

@NonNull
public static final FragmentTransaction <F extends Fragment> FragmentTransactionKt.add(
    @NonNull FragmentTransaction receiver,
    @NonNull String tag,
    @Nullable Bundle args
)

Add a fragment to the associated FragmentManager without adding the Fragment to any container view.

The new fragment to be added will be created via the FragmentFactory of the FragmentManager.

Parameters
@NonNull String tag

Tag name for the fragment, to later retrieve the fragment with FragmentManager.findFragmentByTag.

@Nullable Bundle args

Optional arguments to be set on the fragment.

Returns
FragmentTransaction

Returns the same FragmentTransaction instance.

FragmentTransactionKt.replace

@NonNull
public static final FragmentTransaction <F extends Fragment> FragmentTransactionKt.replace(
    @NonNull FragmentTransaction receiver,
    @IdRes int containerViewId,
    @Nullable String tag,
    @Nullable