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
Interface for interacting with Fragment
objects inside of an Activity
<div class="special reference"> <h3>Developer Guides</h3>
For more information about using fragments, read the Fragments developer guide.
</div>
While the FragmentManager API was introduced in android.os.Build.VERSION_CODES#HONEYCOMB
, a version of the API at is also available for use on older platforms through androidx.fragment.app.FragmentActivity
. See the blog post Fragments For All for more details.
This member is deprecated. Use the Support Libraryandroidx.fragment.app.FragmentManager
for consistent behavior across all devices and access to Lifecycle.
Java documentation 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
FragmentManager() | |
FragmentManager(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Fields
PopBackStackInclusive |
Flag for |
Properties
BackStackEntryCount |
Return the number of entries currently in the back stack. |
Class |
Returns the runtime class of this |
Fragments | |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
IsDestroyed |
Returns true if the final OnDestroy() call has been made on the FragmentManager's Activity, so this instance is now dead. |
IsStateSaved | |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
PeerReference | (Inherited from Object) |
PrimaryNavigationFragment | |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
Methods
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) |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
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) |
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) | |
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) | |
GetBackStackEntryAt(Int32) |
Return the BackStackEntry at index <var>index</var> 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) | |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
InvalidateOptionsMenu() |
Invalidate the attached activity's options menu as necessary. |
JavaFinalize() |
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 |
RemoveOnBackStackChangedListener(FragmentManager+IOnBackStackChangedListener) |
Remove a listener that was previously added with
|
SaveFragmentInstanceState(Fragment) |
Save the current instance state of the given Fragment. |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
UnregisterFragmentLifecycleCallbacks(FragmentManager+FragmentLifecycleCallbacks) |
Unregisters a previously registered |
UnregisterFromRuntime() | (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
BackStackChanged |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |