Android Guides | Samples

Android.App.FragmentManager Class

Interface for interacting with Fragment objects inside of an Activity

Developer Guides

While the FragmentManager API was introduced in Build+VERSION_CODES.Honeycomb, a version of the API at is also available for use on older platforms through NoType:android/support/v4/app/FragmentActivity;Href=../../../reference/android/support/v4/app/FragmentActivity.html.

See Also: FragmentManager

Syntax

[Android.Runtime.Register("android/app/FragmentManager", DoNotGenerateAcw=true)]
public abstract class FragmentManager : Object

Remarks

Interface for interacting with Fragment objects inside of an Activity

Developer Guides

While the FragmentManager API was introduced in Build+VERSION_CODES.Honeycomb, a version of the API at is also available for use on older platforms through NoType:android/support/v4/app/FragmentActivity;Href=../../../reference/android/support/v4/app/FragmentActivity.html. See the blog post for more details.

For more information about using fragments, read the Fragments developer guide.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11

The members of Android.App.FragmentManager are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
PopBackStackInclusivePopBackStackFlags (1). Flag for FragmentManager.PopBackStack(String,PopBackStackFlags) and FragmentManager.PopBackStack(Int32,PopBackStackFlags): If set, and the name or ID of a back stack entry has been supplied, then all matching entries will be consumed until one that doesn't match is found or the bottom of the stack is reached.

Public Properties

[read-only]
abstract
BackStackEntryCountInt32. Return the number of entries currently in the back stack.
[read-only]
abstract
IsDestroyedBoolean. Returns true if the final Activity.OnDestroy call has been made on the FragmentManager's Activity, so this instance is now dead.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

abstract
AddOnBackStackChangedListener(FragmentManager+IOnBackStackChangedListener)
Add a new listener for changes to the fragment back stack.
abstract
BeginTransaction() : FragmentTransaction
Start a series of edit operations on the Fragments associated with this FragmentManager.
abstract
Dump(String, FileDescriptor, PrintWriter, String[])
Print the FragmentManager's state into the given stream.
static
EnableDebugLogging(Boolean)
Control whether the framework's internal fragment manager debugging logs are turned on.
abstract
ExecutePendingTransactions() : Boolean
After a FragmentTransaction is committed with FragmentTransaction.Commit, it is scheduled to be executed asynchronously on the process's main thread.
abstract
FindFragmentById(Int32) : Fragment
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) : T
abstract
FindFragmentByTag(String) : Fragment
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) : T
abstract
GetBackStackEntryAt(Int32) : FragmentManager+IBackStackEntry
Return the BackStackEntry at index index in the back stack; where the item on the bottom of the stack has index 0.
abstract
GetFragment(Bundle, String) : Fragment
Retrieve the current Fragment instance for a reference previously placed with FragmentManager.PutFragment(Bundle,String,String).
GetFragment<T>(Bundle, String) : T
InvalidateOptionsMenu()
Invalidate the attached activity's options menu as necessary.
abstract
PopBackStack()
Pop the top state off the back stack.
abstract
PopBackStack(Int32, PopBackStackFlags)
Pop all back stack states up to the one with the given identifier.
abstract
PopBackStack(String, PopBackStackFlags)
Pop the last fragment transition from the manager's fragment back stack.
abstract
PopBackStackImmediate() : Boolean
Like FragmentManager.PopBackStack, but performs the operation immediately inside of the call.
abstract
PopBackStackImmediate(Int32, PopBackStackFlags) : Boolean
Like FragmentManager.PopBackStack(Int32,PopBackStackFlags), but performs the operation immediately inside of the call.
abstract
PopBackStackImmediate(String, PopBackStackFlags) : Boolean
Like FragmentManager.PopBackStack(String,PopBackStackFlags), but performs the operation immediately inside of the call.
abstract
PutFragment(Bundle, String, Fragment)
Put a reference to a fragment in a Bundle.
abstract
RemoveOnBackStackChangedListener(FragmentManager+IOnBackStackChangedListener)
Remove a listener that was previously added with FragmentManager.AddOnBackStackChangedListener(.IOnBackStackChangedListener).
abstract
SaveFragmentInstanceState(Fragment) : Fragment+SavedState
Save the current instance state of the given Fragment.

Public Events