/**@class android.app.FragmentManager
@extends java.lang.Object
Interface for interacting with {@link android.app.Fragment} objects inside of an
{@link android.app.Activity}
<div class="special reference">
<h3>Developer Guides</h3>
<p>For more information about using fragments, read the
<a href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</p>
</div>
While the FragmentManager API was introduced in
{@link android.os.Build.VERSION_CODES#HONEYCOMB}, a version of the API
at is also available for use on older platforms through
{@link android.support.v4.app.FragmentActivity}. See the blog post
<a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">
Fragments For All</a> for more details.
@deprecated Use the <a href="{@docRoot}tools/extras/support-library.html">Support Library</a>
{@link android.support.v4.app.FragmentManager} for consistent behavior across all devices
and access to <a href="{@docRoot}topic/libraries/architecture/lifecycle.html">Lifecycle</a>.
*/
var FragmentManager = {
/** Flag for {@link #popBackStack(String, int)}
and {@link #popBackStack(int, int)}: 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. Otherwise, all entries up to but not including that entry
will be removed.
*/
POP_BACK_STACK_INCLUSIVE : "1",
/**Start a series of edit operations on the Fragments associated with
this FragmentManager.
<p>Note: A fragment transaction can only be created/committed prior
to an activity saving its state. If you try to commit a transaction
after {@link android.app.Activity#onSaveInstanceState android.app.Activity.onSaveInstanceState()}
(and prior to a following {@link android.app.Activity#onStart android.app.Activity.onStart}
or {@link android.app.Activity#onResume android.app.Activity.onResume()}, you will get an error.
This is because the framework takes care of saving your current fragments
in the state, and if changes are made after the state is saved then they
will be lost.</p>
*/
beginTransaction : function( ) {},
/**
@hide -- remove once prebuilts are in.
*/
openTransaction : function( ) {},
/**After a {@link android.app.FragmentTransaction} is committed with
{@link android.app.FragmentTransaction#commit android.app.FragmentTransaction.commit()}, it
is scheduled to be executed asynchronously on the process's main thread.
If you want to immediately executing any such pending operations, you
can call this function (only from the main thread) to do so. Note that
all callbacks and other related behavior will be done from within this
call, so be careful about where this is called from.
<p>
This also forces the start of any postponed Transactions where
{@link android.app.Fragment#postponeEnterTransition()} has been called.
@return {Boolean} Returns true if there were any pending transactions to be
executed.
*/
executePendingTransactions : function( ) {},
/**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. This first
searches through fragments that are currently added to the manager's
activity; if no such fragment is found, then all fragments currently
on the back stack associated with this ID are searched.
@return {Object {android.app.Fragment}} The fragment if found or null otherwise.
*/
findFragmentById : function( ) {},
/**Finds a fragment that was identified by the given tag either when inflated
from XML or as supplied when added in a transaction. This first
searches through fragments that are currently added to the manager's
activity; if no such fragment is found, then all fragments currently
on the back stack are searched.
@return {Object {android.app.Fragment}} The fragment if found or null otherwise.
*/
findFragmentByTag : function( ) {},
/**Pop the top state off the back stack. This function is asynchronous -- it
enqueues the request to pop, but the action will not be performed until the
application returns to its event loop.
*/
popBackStack : function( ) {},
/**Like {@link #popBackStack}(), but performs the operation immediately
inside of the call. This is like calling {@link #executePendingTransactions}()
afterwards without forcing the start of postponed Transactions.
@return {Boolean} Returns true if there was something popped, else false.
*/
popBackStackImmediate : function( ) {},
/**Pop the last fragment transition from the manager's fragment
back stack. If there is nothing to pop, false is returned.
This function is asynchronous -- it enqueues the
request to pop, but the action will not be performed until the application
returns to its event loop.
@param {String} name If non-null, this is the name of a previous back state
to look for; if found, all states up to that state will be popped. The
{@link #POP_BACK_STACK_INCLUSIVE} flag can be used to control whether
the named state itself is popped. If null, only the top state is popped.
@param {Number} flags Either 0 or {@link #POP_BACK_STACK_INCLUSIVE}.
*/
popBackStack : function( ) {},
/**Like {@link #popBackStack(String, int)}, but performs the operation immediately
inside of the call. This is like calling {@link #executePendingTransactions}()
afterwards without forcing the start of postponed Transactions.
@return {Boolean} Returns true if there was something popped, else false.
*/
popBackStackImmediate : function( ) {},
/**Pop all back stack states up to the one with the given identifier.
This function is asynchronous -- it enqueues the
request to pop, but the action will not be performed until the application
returns to its event loop.
@param {Number} id Identifier of the stated to be popped. If no identifier exists,
false is returned.
The identifier is the number returned by
{@link FragmentTransaction#commit() FragmentTransaction.commit()}. The
{@link #POP_BACK_STACK_INCLUSIVE} flag can be used to control whether
the named state itself is popped.
@param {Number} flags Either 0 or {@link #POP_BACK_STACK_INCLUSIVE}.
*/
popBackStack : function( ) {},
/**Like {@link #popBackStack(int, int)}, but performs the operation immediately
inside of the call. This is like calling {@link #executePendingTransactions}()
afterwards without forcing the start of postponed Transactions.
@return {Boolean} Returns true if there was something popped, else false.
*/
popBackStackImmediate : function( ) {},
/**Return the number of entries currently in the back stack.
*/
getBackStackEntryCount : function( ) {},
/**Return the BackStackEntry at index <var>index</var> in the back stack;
where the item on the bottom of the stack has index 0.
*/
getBackStackEntryAt : function( ) {},
/**Add a new listener for changes to the fragment back stack.
*/
addOnBackStackChangedListener : function( ) {},
/**Remove a listener that was previously added with
{@link #addOnBackStackChangedListener}(OnBackStackChangedListener).
*/
removeOnBackStackChangedListener : function( ) {},
/**Put a reference to a fragment in a Bundle. This Bundle can be
persisted as saved state, and when later restoring
{@link #getFragment(Bundle, String)} will return the current
instance of the same fragment.
@param {Object {Bundle}} bundle The bundle in which to put the fragment reference.
@param {String} key The name of the entry in the bundle.
@param {Object {Fragment}} fragment The Fragment whose reference is to be stored.
*/
putFragment : function( ) {},
/**Retrieve the current Fragment instance for a reference previously
placed with {@link #putandroid.app.Fragment(Bundle, String, android.app.Fragment)}.
@param {Object {Bundle}} bundle The bundle from which to retrieve the fragment reference.
@param {String} key The name of the entry in the bundle.
@return {Object {android.app.Fragment}} Returns the current Fragment instance that is associated with
the given reference.
*/
getFragment : function( ) {},
/**Get a list of all fragments that are currently added to the FragmentManager.
This may include those that are hidden as well as those that are shown.
This will not include any fragments only in the back stack, or fragments that
are detached or removed.
<p>
The order of the fragments in the list is the order in which they were
added or attached.
@return {Object {java.util.List}} A list of all fragments that are added to the FragmentManager.
*/
getFragments : function( ) {},
/**Save the current instance state of the given Fragment. This can be
used later when creating a new instance of the Fragment and adding
it to the fragment manager, to have it create itself to match the
current state returned here. Note that there are limits on how
this can be used:
<ul>
<li>The Fragment must currently be attached to the FragmentManager.
<li>A new Fragment created using this saved state must be the same class
type as the Fragment it was created from.
<li>The saved state can not contain dependencies on other fragments --
that is it can't use {@link #putandroid.app.Fragment(Bundle, String, android.app.Fragment)} to
store a fragment reference because that reference may not be valid when
this saved state is later used. Likewise the Fragment's target and
result code are not included in this state.
</ul>
@param {Object {Fragment}} f The Fragment whose state is to be saved.
@return {Object {android.app.Fragment.SavedState}} The generated state. This will be null if there was no
interesting state created by the fragment.
*/
saveFragmentInstanceState : function( ) {},
/**Returns true if the final {@link android.app.Activity#onDestroy() android.app.Activity.onDestroy()}
call has been made on the FragmentManager's Activity, so this instance is now dead.
*/
isDestroyed : function( ) {},
/**Registers a {@link android.app.FragmentManager.FragmentLifecycleCallbacks} to listen to fragment lifecycle events
happening in this FragmentManager. All registered callbacks will be automatically
unregistered when this FragmentManager is destroyed.
@param {Object {FragmentManager.FragmentLifecycleCallbacks}} cb Callbacks to register
@param {Boolean} recursive true to automatically register this callback for all child FragmentManagers
*/
registerFragmentLifecycleCallbacks : function( ) {},
/**Unregisters a previously registered {@link android.app.FragmentManager.FragmentLifecycleCallbacks}. If the callback
was not previously registered this call has no effect. All registered callbacks will be
automatically unregistered when this FragmentManager is destroyed.
@param {Object {FragmentManager.FragmentLifecycleCallbacks}} cb Callbacks to unregister
*/
unregisterFragmentLifecycleCallbacks : function( ) {},
/**Return the currently active primary navigation fragment for this FragmentManager.
<p>The primary navigation fragment's
{@link Fragment#getChildandroid.app.FragmentManager() child android.app.FragmentManager} will be called first
to process delegated navigation actions such as {@link #popBackStack}() if no ID
or transaction name is provided to pop to.</p>
@return {Object {android.app.Fragment}} the fragment designated as the primary navigation fragment
*/
getPrimaryNavigationFragment : function( ) {},
/**Print the FragmentManager's state into the given stream.
@param {String} prefix Text to print at the front of each line.
@param {Object {FileDescriptor}} fd The raw file descriptor that the dump is being sent to.
@param {Object {PrintWriter}} writer A PrintWriter to which the dump is to be set.
@param {Object {java.lang.String[]}} args Additional arguments to the dump request.
*/
dump : function( ) {},
/**Control whether the framework's internal fragment manager debugging
logs are turned on. If enabled, you will see output in logcat as
the framework performs fragment operations.
*/
enableDebugLogging : function( ) {},
/**Invalidate the attached activity's options menu as necessary.
This may end up being deferred until we move to the resumed state.
*/
invalidateOptionsMenu : function( ) {},
/**Returns {@code true} if the FragmentManager's state has already been saved
by its host. Any operations that would change saved state should not be performed
if this method returns true. For example, any popBackStack() method, such as
{@link #popBackStackImmediate}() or any FragmentTransaction using
{@link android.app.FragmentTransaction#commit()} instead of
{@link android.app.FragmentTransaction#commitAllowingStateLoss()} will change
the state and will result in an error.
@return {Boolean} true if this FragmentManager's state has already been saved by its host
*/
isStateSaved : function( ) {},
};