FragmentTransaction

public abstract class FragmentTransaction


Static library support version of the framework's android.app.FragmentTransaction. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Summary

Constants

static final @NonNull int

Bit mask that is set for all enter transitions.

static final @NonNull int

Bit mask that is set for all exit transitions.

static final @NonNull int

Fragment is being removed from the stack

static final @NonNull int

Fragment should simply fade in or out; that is, no strong navigation associated with it except that it is appearing or disappearing for some reason.

static final @NonNull int

Fragment is being removed from the stack with Activity close transition.

static final @NonNull int

Fragment is being added onto the stack with Activity open transition.

static final @NonNull int

Fragment is being added onto the stack

static final @NonNull int

No animation for transition.

static final @NonNull int

Not set up for a transition.

Public constructors

This method is deprecated.

You should not instantiate a FragmentTransaction except via beginTransaction.

Public methods

final @NonNull FragmentTransaction
add(
    @NonNull Class<@NonNull Fragment> fragmentClass,
    @Nullable Bundle args,
    @Nullable String tag
)

Calls add with a 0 containerViewId.

@NonNull FragmentTransaction
add(@NonNull Fragment fragment, @Nullable String tag)

Calls add with a 0 containerViewId.

final @NonNull FragmentTransaction
add(
    @IdRes @NonNull int containerViewId,
    @NonNull Class<@NonNull Fragment> fragmentClass,
    @Nullable Bundle args
)

Calls add with a null tag.

@NonNull FragmentTransaction
add(@IdRes @NonNull int containerViewId, @NonNull Fragment fragment)

Calls add with a null tag.

final @NonNull FragmentTransaction
add(
    @IdRes @NonNull int containerViewId,
    @NonNull Class<@NonNull Fragment> fragmentClass,
    @Nullable Bundle args,
    @Nullable String tag
)

Add a fragment to the activity state.

@NonNull FragmentTransaction
add(
    @IdRes @NonNull int containerViewId,
    @NonNull Fragment fragment,
    @Nullable String tag
)

Add a fragment to the activity state.

@NonNull FragmentTransaction
addSharedElement(@NonNull View sharedElement, @NonNull String name)

Used with custom Transitions to map a View from a removed or hidden Fragment to a View from a shown or added Fragment.

@NonNull FragmentTransaction

Add this transaction to the back stack.

@NonNull FragmentTransaction
attach(@NonNull Fragment fragment)

Re-attach a fragment after it had previously been detached from the UI with detach.

abstract @NonNull int

Schedules a commit of this transaction.

abstract @NonNull int

Like commit but allows the commit to be executed after an activity's state is saved.

abstract @NonNull void

Commits this transaction synchronously.

abstract @NonNull void

Like commitNow but allows the commit to be executed after an activity's state is saved.

@NonNull FragmentTransaction