{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

FragmentManager.OnBackStackChangedListener

Added in 1.1.0

interface FragmentManager.OnBackStackChangedListener


Interface to watch for changes to the back stack.

Summary

Public functions

Unit

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

Unit

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

Unit

Called whenever the contents of the back stack change.

Public functions

onBackStackChangeCommitted

Added in 1.6.0
@MainThread
fun onBackStackChangeCommitted(fragment: Fragment, pop: Boolean): Unit

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

Parameters
fragment: Fragment

that is affected by the committed back stack change

pop: Boolean

whether this back stack change is a pop

onBackStackChangeStarted

Added in 1.6.0
@MainThread
fun onBackStackChangeStarted(fragment: Fragment, pop: Boolean): Unit

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

Parameters
fragment: Fragment

that is affected by the starting back stack change

pop: Boolean

whether this back stack change is a pop

onBackStackChanged

Added in 1.1.0
@MainThread
fun onBackStackChanged(): Unit

Called whenever the contents of the back stack change.