FragmentManager.OnBackStackChangedListener

public interface FragmentManager.OnBackStackChangedListener


Interface to watch for changes to the back stack.

Summary

Public methods

default void

Called whenever a predictive back gesture is cancelled.

default void

Called whenever the contents of a back stack change is committed.

default void

Called whenever a predictive back gesture is changing the back stack.

default void

Called whenever the contents of the back stack are starting to be changed, before fragments being to move to their target states.

abstract void

Called whenever the contents of the back stack change.

Public methods

onBackStackChangeCancelled

Added in 1.7.0-alpha10
@MainThread
default void onBackStackChangeCancelled()

Called whenever a predictive back gesture is cancelled.

onBackStackChangeCommitted

Added in 1.6.0
@MainThread
default void onBackStackChangeCommitted(@NonNull Fragment fragment, boolean pop)

Called whenever the contents of a back stack change is committed.

Parameters
@NonNull Fragment fragment

that is affected by the committed back stack change

boolean pop

whether this back stack change is a pop

onBackStackChangeProgressed

Added in 1.7.0-alpha10
@MainThread
default void onBackStackChangeProgressed(@NonNull BackEventCompat backEventCompat)

Called whenever a predictive back gesture is changing the back stack.

Parameters
@NonNull BackEventCompat backEventCompat

event that holds the current back gesture data

onBackStackChangeStarted

Added in 1.6.0
@MainThread
default void onBackStackChangeStarted(@NonNull Fragment fragment, boolean pop)

Called whenever the contents of the back stack are starting to be changed, before fragments being to move to their target states.

Parameters
@NonNull Fragment fragment

that is affected by the starting back stack change

boolean pop

whether this back stack change is a pop

onBackStackChanged

Added in 1.1.0
@MainThread
abstract void onBackStackChanged()

Called whenever the contents of the back stack change.