FragmentManager Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Interface for interacting with Fragment objects inside of an
Activity<div class="special reference">
<h3>Developer Guides</h3>
[Android.Runtime.Register("android/app/FragmentManager", DoNotGenerateAcw=true)]
public abstract class FragmentManager : Java.Lang.Object
[<Android.Runtime.Register("android/app/FragmentManager", DoNotGenerateAcw=true)>]
type FragmentManager = class
inherit Object
- Inheritance
- Attributes
Remarks
This class was deprecated in API level 28. Use the Support Library FragmentManager for consistent behavior across all devices and access to Lifecycle.
Interface for interacting with Fragment objects inside of an Activity Developer Guides For more information about using fragments, read the Fragments developer guide.
Android reference for android.app.FragmentManager.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
| Name | Description |
|---|---|
| FragmentManager() | |
| FragmentManager(IntPtr, JniHandleOwnership) |
Initializes a managed representation of an existing Java Native Interface object. |
Fields
| Name | Description |
|---|---|
| PopBackStackInclusive |
Flag for |
Properties
| Name | Description |
|---|---|
| BackStackEntryCount |
Return the number of entries currently in the back stack. |
| Class |
Returns the runtime class of this |
| Fragments |
Get a list of all fragments that are currently added to the FragmentManager. |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| IsDestroyed |
Returns true if the final Activity.onDestroy() call has been made on the FragmentManager's Activity, so this instance is now dead. |
| IsStateSaved |
Returns true if the FragmentManager's state has already been saved by its host. |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState | (Inherited from JavaObject) |
| JniPeerMembers |
Provides JNI binding infrastructure for Android.App.FragmentManager. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| PrimaryNavigationFragment |
Return the currently active primary navigation fragment for this FragmentManager. |
| ThresholdClass |
Provides JNI binding infrastructure for Android.App.FragmentManager. |
| ThresholdType |
Provides JNI binding infrastructure for Android.App.FragmentManager. |
Methods
| Name | Description |
|---|---|
| AddOnBackStackChangedListener(FragmentManager+IOnBackStackChangedListener) |
Add a new listener for changes to the fragment back stack. |
| BeginTransaction() |
Start a series of edit operations on the Fragments associated with this FragmentManager. |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() | (Inherited from JavaObject) |
| Dump(String, FileDescriptor, PrintWriter, String[]) |
Print the FragmentManager's state into the given stream. |
| EnableDebugLogging(Boolean) |
Control whether the framework's internal fragment manager debugging logs are turned on. |
| Equals(Object) | (Inherited from JavaObject) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| ExecutePendingTransactions() |
After a |
| FindFragmentById(Int32) |
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. |
| FindFragmentById<T>(Int32) |
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, and returns
it cast to |
| FindFragmentByTag(String) |
Finds a fragment that was identified by the given tag either when inflated from XML or as supplied when added in a transaction. |
| FindFragmentByTag<T>(String) |
Finds a Fragment that was identified by the given tag, either when
inflated from XML or as supplied when added in a transaction, and returns it cast
to |
| GetBackStackEntryAt(Int32) |
Return the BackStackEntry at index index in the back stack; where the item on the bottom of the stack has index 0. |
| GetFragment(Bundle, String) |
Retrieve the current Fragment instance for a reference previously
placed with |
| GetFragment<T>(Bundle, String) |
Retrieves the current Fragment instance for a reference previously
placed in |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| InvalidateOptionsMenu() |
Invalidate the attached activity's options menu as necessary. |
| JavaFinalize() |
Obsolete.
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| PopBackStack() |
Pop the top state off the back stack. |
| PopBackStack(Int32, PopBackStackFlags) |
Pop all back stack states up to the one with the given identifier. |
| PopBackStack(String, PopBackStackFlags) |
Pop the last fragment transition from the manager's fragment back stack. |
| PopBackStackImmediate() |
Like |
| PopBackStackImmediate(Int32, PopBackStackFlags) |
Like |
| PopBackStackImmediate(String, PopBackStackFlags) |
Like |
| PutFragment(Bundle, String, Fragment) |
Put a reference to a fragment in a Bundle. |
| RegisterFragmentLifecycleCallbacks(FragmentManager+FragmentLifecycleCallbacks, Boolean) |
Registers a FragmentLifecycleCallbacks to listen to fragment lifecycle events happening in this FragmentManager. |
| RemoveOnBackStackChangedListener(FragmentManager+IOnBackStackChangedListener) |
Remove a listener that was previously added with addOnBackStackChangedListener(OnBackStackChangedListener). |
| SaveFragmentInstanceState(Fragment) |
Save the current instance state of the given Fragment. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFragmentLifecycleCallbacks(FragmentManager+FragmentLifecycleCallbacks) |
Unregisters a previously registered FragmentLifecycleCallbacks. |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Events
| Name | Description |
|---|---|
| BackStackChanged | |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IJavaPeerable.Disposed() | (Inherited from JavaObject) |
| IJavaPeerable.Finalized() | (Inherited from JavaObject) |
| IJavaPeerable.JniObjectReferenceControlBlock | (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from JavaObject) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |