FragmentManager
abstract class FragmentManager : FragmentResultOwner
kotlin.Any | |
↳ | androidx.fragment.app.FragmentManager |
Static library support version of the framework's android.app.FragmentManager
. 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 FragmentManager
documentation for a class overview.
Your activity must derive from FragmentActivity
to use this. From such an activity, you can acquire the FragmentManager
by calling FragmentActivity#getSupportFragmentManager
.
Summary
Nested classes | |
---|---|
abstract |
Representation of an entry on the fragment back stack, as created with |
abstract |
Callback interface for listening to fragment state changes that happen within a given FragmentManager. |
abstract |
Interface to watch for changes to the back stack. |
Constants | |
---|---|
static Int |
Flag for |
Public constructors | |
---|---|
<init>() Static library support version of the framework's |
Public methods | |
---|---|
open Unit |
addFragmentOnAttachListener(@NonNull listener: FragmentOnAttachListener) Add a |
open Unit |
addOnBackStackChangedListener(@NonNull listener: FragmentManager.OnBackStackChangedListener) Add a new listener for changes to the fragment back stack. |
open FragmentTransaction |
Start a series of edit operations on the Fragments associated with this FragmentManager. |
Unit |
clearFragmentResult(@NonNull requestKey: String) |
Unit |
clearFragmentResultListener(@NonNull requestKey: String) |
open Unit |
dump(@NonNull prefix: String, @Nullable fd: FileDescriptor?, @NonNull writer: PrintWriter, @Nullable args: Array<String!>?) Print the FragmentManager's state into the given stream. |
open static Unit |
enableDebugLogging(enabled: Boolean) Control whether the framework's internal fragment manager debugging logs are turned on. |
open static Unit |
enableNewStateManager(enabled: Boolean) Control whether FragmentManager uses the new state manager that is responsible for:
|
open Boolean |
After a |
open static F |
findFragment(@NonNull view: View) |
open Fragment? |
findFragmentById(@IdRes id: Int) Finds a fragment that was identified by the given id either when inflated from XML or as the container ID when added in a transaction. |
open Fragment? |
findFragmentByTag(@Nullable tag: String?) Finds a fragment that was identified by the given tag either when inflated from XML or as supplied when added in a transaction. |
open FragmentManager.BackStackEntry |
getBackStackEntryAt(index: Int) Return the BackStackEntry at index index in the back stack; entries start index 0 being the bottom of the stack. |
open Int |
Return the number of entries currently in the back stack. |
open Fragment? |
getFragment(@NonNull bundle: Bundle, @NonNull key: String) Retrieve the current Fragment instance for a reference previously placed with |
open FragmentFactory |
Gets the current |
open MutableList<Fragment!> |
Get a list of all fragments that are currently added to the FragmentManager. |
open Fragment? |
Return the currently active primary navigation fragment for this FragmentManager. |
open Boolean |
Returns true if the final |
open Boolean |
Returns |
open Unit |
Pop the top state off the back stack. |
open Unit |
popBackStack(@Nullable nam |