FragmentManagerKt

public final class FragmentManagerKt


Summary

Public methods

static final void
FragmentManagerKt.commit(
    FragmentManager receiver,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

static final void
FragmentManagerKt.commitNow(
    FragmentManager receiver,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

static final void
FragmentManagerKt.transaction(
    FragmentManager receiver,
    boolean now,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

This method is deprecated. Use commit { ..

Public methods

FragmentManagerKt.commit

public static final void FragmentManagerKt.commit(
    FragmentManager receiver,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

The transaction will be completed by calling FragmentTransaction.commit unless allowStateLoss is set to true in which case FragmentTransaction.commitAllowingStateLoss will be used.

FragmentManagerKt.commitNow

public static final void FragmentManagerKt.commitNow(
    FragmentManager receiver,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

The transaction will be completed by calling FragmentTransaction.commitNow unless allowStateLoss is set to true in which case FragmentTransaction.commitNowAllowingStateLoss will be used.

FragmentManagerKt.transaction

public static final void FragmentManagerKt.transaction(
    FragmentManager receiver,
    boolean now,
    boolean allowStateLoss,
    @ExtensionFunctionType Function1<FragmentTransactionUnit> body
)

Run body in a FragmentTransaction which is automatically committed if it completes without exception.

One of four commit functions will be used based on the values of now and allowStateLoss:

    |  now  |  allowStateLoss  | Method                         |
    | ----- | ---------------- | ------------------------------ |
    | false | false            |  commit()                      |
    | false | true             |  commitAllowingStateLoss()     |
    | true  | false            |  commitNow()                   |
    | true  | true             |  commitNowAllowingStateLoss()  |