blob: d34bb0de0cd8d902a0bc15f97d6d0ec402207c9f [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentManager</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<div id="metadata-info-block"></div>
<h1>FragmentManager</h1>
<p>
<pre>public abstract class <a href="/reference/androidx/fragment/app/FragmentManager.html">FragmentManager</a> implements <a href="/reference/androidx/fragment/app/FragmentResultOwner.html">FragmentResultOwner</a></pre>
</p>
<hr>
<p>Static library support version of the framework's <code><a href="https://developer.android.com/reference/android/app/FragmentManager.html">android.app.FragmentManager</a></code>. 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 <code><a href="/reference/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code> documentation for a class overview. </p>
<p>Your activity must derive from <code><a href="/reference/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code> to use this. From such an activity, you can acquire the <code><a href="/reference/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code> by calling <code><a href="/reference/androidx/fragment/app/FragmentActivity.html#getSupportFragmentManager()">getSupportFragmentManager</a></code>.</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Nested types</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td>
<div><code>public interface <a href="/reference/androidx/fragment/app/FragmentManager.BackStackEntry.html">FragmentManager.BackStackEntry</a></code></div>
<p>Representation of an entry on the fragment back stack, as created with <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#addToBackStack(java.lang.String)">FragmentTransaction.addToBackStack()</a></code>.</p>
</td>
</tr>
<tr>
<td>
<div><code>public abstract class <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a></code></div>
<p>Callback interface for listening to fragment state changes that happen within a given FragmentManager.</p>
</td>
</tr>
<tr>
<td>
<div><code>public interface <a href="/reference/androidx/fragment/app/FragmentManager.OnBackStackChangedListener.html">FragmentManager.OnBackStackChangedListener</a></code></div>
<p>Interface to watch for changes to the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Constants</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>static&nbsp;final int</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a> = 1</code></div>
<p>Flag for <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a></code> and <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a></code>: 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.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public constructors</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#FragmentManager()">FragmentManager</a>()</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public methods</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">addFragmentOnAttachListener</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener)</code></div>
<p>Add a <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a></code> that should receive a call to <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html#onAttachFragment(androidx.fragment.app.FragmentManager,androidx.fragment.app.Fragment)">onAttachFragment</a></code> when a new Fragment is attached to this FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">addOnBackStackChangedListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.OnBackStackChangedListener.html">FragmentManager.OnBackStackChangedListener</a>&nbsp;listener<br>)</code></div>
<p>Add a new listener for changes to the fragment back stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#beginTransaction()">beginTransaction</a>()</code></div>
<p>Start a series of edit operations on the Fragments associated with this FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#clearBackStack(java.lang.String)">clearBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</code></div>
<p>Clears the back stack previously saved via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#clearFragmentResult(java.lang.String)">clearFragmentResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey)</code></div>
<p>Clears the stored result for the given requestKey.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#clearFragmentResultListener(java.lang.String)">clearFragmentResultListener</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey)</code></div>
<p>Clears the stored <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> for the given requestKey.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">dump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> String[]&nbsp;args<br>)</code></div>
<p>Print the FragmentManager's state into the given stream.</p>
</td>
</tr>
<tr>
<td width="40%"><code>static void</code></td>
<td>
<div><code><span><del><a href="/reference/androidx/fragment/app/FragmentManager.html#enableDebugLogging(boolean)">enableDebugLogging</a></del></span>(boolean&nbsp;enabled)</code></div>
<p><strong>This method is deprecated.</strong>
<p>FragmentManager now respects <code><a href="https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String,int)">isLoggable</a></code> for debug logging, allowing you to use <code>adb shell setprop log.tag.FragmentManager VERBOSE</code>.</p>
</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">executePendingTransactions</a>()</code></div>
<p>After a <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code> is committed with <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commit()">FragmentTransaction.commit()</a></code>, it is scheduled to be executed asynchronously on the process's main thread.</p>
</td>
</tr>
<tr>
<td width="40%"><code>static @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> F</code></td>
<td>
<div><code>&lt;F&nbsp;extends&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&gt; <a href="/reference/androidx/fragment/app/FragmentManager.html#findFragment(android.view.View)">findFragment</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/view/View.html">View</a>&nbsp;view)</code></div>
<p>Find a <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code> associated with the given <code><a href="https://developer.android.com/reference/android/view/View.html">View</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#findFragmentById(int)">findFragmentById</a>(@<a href="/reference/androidx/annotation/IdRes.html">IdRes</a> int&nbsp;id)</code></div>
<p>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.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#findFragmentByTag(java.lang.String)">findFragmentByTag</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;tag)</code></div>
<p>Finds a fragment that was identified by the given tag either when inflated from XML or as supplied when added in a transaction.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.BackStackEntry.html">FragmentManager.BackStackEntry</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getBackStackEntryAt(int)">getBackStackEntryAt</a>(int&nbsp;index)</code></div>
<p>Return the BackStackEntry at index <var>index</var> in the back stack; entries start index 0 being the bottom of the stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>int</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getBackStackEntryCount()">getBackStackEntryCount</a>()</code></div>
<p>Return the number of entries currently in the back stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getFragment(android.os.Bundle,java.lang.String)">getFragment</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key)</code></div>
<p>Retrieve the current Fragment instance for a reference previously placed with <code><a href="/reference/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">getFragmentFactory</a>()</code></div>
<p>Gets the current <code><a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code> used to instantiate new Fragment instances.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&gt;</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getFragments()">getFragments</a>()</code></div>
<p>Get a list of all fragments that are currently added to the FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getPrimaryNavigationFragment()">getPrimaryNavigationFragment</a>()</code></div>
<p>Return the currently active primary navigation fragment for this FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/strictmode/FragmentStrictMode.Policy.html">FragmentStrictMode.Policy</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getStrictModePolicy()">getStrictModePolicy</a>()</code></div>
<p>Returns the current policy for this FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#isDestroyed()">isDestroyed</a>()</code></div>
<p>Returns true if the final <code><a href="https://developer.android.com/reference/android/app/Activity.html#onDestroy()">Activity.onDestroy()</a></code> call has been made on the FragmentManager's Activity, so this instance is now dead.</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#isStateSaved()">isStateSaved</a>()</code></div>
<p>Returns <code>true</code> if the FragmentManager's state has already been saved by its host.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack()">popBackStack</a>()</code></div>
<p>Pop the top state off the back stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a>(int&nbsp;id,&nbsp;int&nbsp;flags)</code></div>
<p>Pop all back stack states up to the one with the given identifier.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name,&nbsp;int&nbsp;flags)</code></div>
<p>Pop the last fragment transition from the manager's fragment back stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate()">popBackStackImmediate</a>()</code></div>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack()">popBackStack</a></code>, but performs the operation immediately inside of the call.</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate(int,int)">popBackStackImmediate</a>(int&nbsp;id,&nbsp;int&nbsp;flags)</code></div>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a></code>, but performs the operation immediately inside of the call.</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate(java.lang.String,int)">popBackStackImmediate</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name,&nbsp;int&nbsp;flags)</code></div>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a></code>, but performs the operation immediately inside of the call.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment<br>)</code></div>
<p>Put a reference to a fragment in a Bundle.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks,boolean)">registerFragmentLifecycleCallbacks</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb,<br>&nbsp;&nbsp;&nbsp;&nbsp;boolean&nbsp;recursive<br>)</code></div>
<p>Registers a <code><a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentLifecycleCallbacks</a></code> to listen to fragment lifecycle events happening in this FragmentManager.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#removeFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">removeFragmentOnAttachListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener<br>)</code></div>
<p>Remove a <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a></code> that was previously added via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">addFragmentOnAttachListener</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">removeOnBackStackChangedListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.OnBackStackChangedListener.html">FragmentManager.OnBackStackChangedListener</a>&nbsp;listener<br>)</code></div>
<p>Remove a listener that was previously added with <code><a href="/reference/androidx/fragment/app/FragmentManager.html#addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">addOnBackStackChangedListener</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#restoreBackStack(java.lang.String)">restoreBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</code></div>
<p>Restores the back stack previously saved via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</code></div>
<p>Save the back stack.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveFragmentInstanceState(androidx.fragment.app.Fragment)">saveFragmentInstanceState</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment)</code></div>
<p>Save the current instance state of the given Fragment.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">setFragmentFactory</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a>&nbsp;fragmentFactory)</code></div>
<p>Set a <code><a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code> for this FragmentManager that will be used to create new Fragment instances from this point onward.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">setFragmentResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;result)</code></div>
<p>Sets the given result for the requestKey.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>&nbsp;lifecycleOwner,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a>&nbsp;listener<br>)</code></div>
<p>Sets the <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> for a given requestKey.</p>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy)">setStrictModePolicy</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/strictmode/FragmentStrictMode.Policy.html">FragmentStrictMode.Policy</a>&nbsp;policy)</code></div>
<p>Sets the policy for what actions should be detected, as well as the penalty if such actions occur.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a></code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#toString()">toString</a>()</code></div>
</td>
</tr>
<tr>
<td width="40%"><code>void</code></td>
<td>
<div><code><a href="/reference/androidx/fragment/app/FragmentManager.html#unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks)">unregisterFragmentLifecycleCallbacks</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb<br>)</code></div>
<p>Unregisters a previously registered <code><a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentLifecycleCallbacks</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="list">
<h2>Constants</h2>
<div class="api-item"><a name="getPOP_BACK_STACK_INCLUSIVE()"></a><a name="setPOP_BACK_STACK_INCLUSIVE()"></a><a name="getPOP_BACK_STACK_INCLUSIVE--"></a><a name="setPOP_BACK_STACK_INCLUSIVE--"></a>
<h3 class="api-name" id="POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</h3>
<pre class="api-signature no-pretty-print">public&nbsp;static&nbsp;final&nbsp;int&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a> = 1</pre>
<p>Flag for <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a></code> and <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a></code>: 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.</p>
</div>
</div>
<div class="list">
<h2>Public constructors</h2>
<div class="api-item"><a name="FragmentManager--"></a><a name="fragmentmanager"></a>
<h3 class="api-name" id="FragmentManager()">FragmentManager</h3>
<pre class="api-signature no-pretty-print">public&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#FragmentManager()">FragmentManager</a>()</pre>
</div>
</div>
<div class="list">
<h2>Public methods</h2>
<div class="api-item"><a name="addFragmentOnAttachListener-androidx.fragment.app.FragmentOnAttachListener-"></a><a name="addfragmentonattachlistener"></a>
<h3 class="api-name" id="addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">addFragmentOnAttachListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">addFragmentOnAttachListener</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener)</pre>
<p>Add a <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a></code> that should receive a call to <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html#onAttachFragment(androidx.fragment.app.FragmentManager,androidx.fragment.app.Fragment)">onAttachFragment</a></code> when a new Fragment is attached to this FragmentManager.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener</code></td>
<td>
<p>Listener to add</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="addOnBackStackChangedListener-androidx.fragment.app.FragmentManager.OnBackStackChangedListener-"></a><a name="addonbackstackchangedlistener"></a>
<h3 class="api-name" id="addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">addOnBackStackChangedListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">addOnBackStackChangedListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.OnBackStackChangedListener.html">FragmentManager.OnBackStackChangedListener</a>&nbsp;listener<br>)</pre>
<p>Add a new listener for changes to the fragment back stack.</p>
</div>
<div class="api-item"><a name="beginTransaction--"></a><a name="begintransaction"></a>
<h3 class="api-name" id="beginTransaction()">beginTransaction</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#beginTransaction()">beginTransaction</a>()</pre>
<p>Start a series of edit operations on the Fragments associated with this FragmentManager. </p>
<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 FragmentActivity.onSaveInstanceState() (and prior to a following <code><a href="/reference/androidx/fragment/app/FragmentActivity.html#onStart()">FragmentActivity.onStart</a></code> or <code><a href="/reference/androidx/fragment/app/FragmentActivity.html#onResume()">FragmentActivity.onResume()</a></code>, 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>
</div>
<div class="api-item"><a name="clearBackStack-java.lang.String-"></a><a name="clearbackstack"></a>
<h3 class="api-name" id="clearBackStack(java.lang.String)">clearBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#clearBackStack(java.lang.String)">clearBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</pre>
<p>Clears the back stack previously saved via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>. This will result in all of the transactions that made up that back stack to be thrown away, thus destroying any fragments that were added through those transactions. All state of those fragments will be cleared as part of this process. If no state was previously saved with the given name, this operation does nothing. </p>
<p> This function is asynchronous -- it enqueues the request to clear, but the action will not be performed until the application returns to its event loop.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name</code></td>
<td>
<p>The name of the back stack previously saved by <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="clearFragmentResult-java.lang.String-"></a><a name="clearfragmentresult"></a>
<h3 class="api-name" id="clearFragmentResult(java.lang.String)">clearFragmentResult</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#clearFragmentResult(java.lang.String)">clearFragmentResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey)</pre>
<p>Clears the stored result for the given requestKey. This clears any result that was previously set via <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#setFragmentResult(java.lang.String,android.os.Bundle)">setFragmentResult</a></code> that hasn't yet been delivered to a <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey</code></td>
<td>
<p>key used to identify the result</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="clearFragmentResultListener-java.lang.String-"></a><a name="clearfragmentresultlistener"></a>
<h3 class="api-name" id="clearFragmentResultListener(java.lang.String)">clearFragmentResultListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#clearFragmentResultListener(java.lang.String)">clearFragmentResultListener</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey)</pre>
<p>Clears the stored <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> for the given requestKey. This clears any <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> that was previously set via <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey</code></td>
<td>
<p>key used to identify the result</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])"></a><a name="dump-java.lang.String-java.io.FileDescriptor-java.io.PrintWriter-java.lang.String[]-"></a><a name="dump"></a>
<h3 class="api-name" id="dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">dump</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">dump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> String[]&nbsp;args<br>)</pre>
<p>Print the FragmentManager's state into the given stream.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix</code></td>
<td>
<p>Text to print at the front of each line.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd</code></td>
<td>
<p>The raw file descriptor that the dump is being sent to.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer</code></td>
<td>
<p>A PrintWriter to which the dump is to be set.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> String[]&nbsp;args</code></td>
<td>
<p>Additional arguments to the dump request.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="enableDebugLogging-boolean-"></a><a name="enabledebuglogging"></a>
<h3 class="api-name" id="enableDebugLogging(boolean)">enableDebugLogging</h3>
<pre class="api-signature no-pretty-print">public&nbsp;static&nbsp;void&nbsp;<span><del><a href="/reference/androidx/fragment/app/FragmentManager.html#enableDebugLogging(boolean)">enableDebugLogging</a></del></span>(boolean&nbsp;enabled)</pre>
<aside class="caution"><strong>This method is deprecated.</strong><br>
<p>FragmentManager now respects <code><a href="https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String,int)">isLoggable</a></code> for debug logging, allowing you to use <code>adb shell setprop log.tag.FragmentManager VERBOSE</code>.</p>
</aside>
<p>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.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">See also</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String,int)">isLoggable</a></code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="executePendingTransactions--"></a><a name="executependingtransactions"></a>
<h3 class="api-name" id="executePendingTransactions()">executePendingTransactions</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">executePendingTransactions</a>()</pre>
<p>After a <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code> is committed with <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commit()">FragmentTransaction.commit()</a></code>, 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>
<p>If you are committing a single transaction that does not modify the fragment back stack, strongly consider using <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commitNow()">commitNow</a></code> instead. This can help avoid unwanted side effects when other code in your app has pending committed transactions that expect different timing.</p>
<p> This also forces the start of any postponed Transactions where <code><a href="/reference/androidx/fragment/app/Fragment.html#postponeEnterTransition()">postponeEnterTransition</a></code> has been called.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<p>Returns true if there were any pending transactions to be executed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="findFragment-android.view.View-"></a><a name="findfragment"></a>
<h3 class="api-name" id="findFragment(android.view.View)">findFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;static&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> F&nbsp;&lt;F&nbsp;extends&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&gt; <a href="/reference/androidx/fragment/app/FragmentManager.html#findFragment(android.view.View)">findFragment</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/view/View.html">View</a>&nbsp;view)</pre>
<p>Find a <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code> associated with the given <code><a href="https://developer.android.com/reference/android/view/View.html">View</a></code>. This method will locate the <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code> associated with this view. This is automatically populated for the View returned by <code><a href="/reference/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> and its children.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/view/View.html">View</a>&nbsp;view</code></td>
<td>
<p>the view to search from</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> F</code></td>
<td>
<p>the locally scoped <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code> to the given view</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Throws</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="https://developer.android.com/reference/java/lang/IllegalStateException.html">java.lang.IllegalStateException</a>&nbsp;java.lang.IllegalStateException</code></td>
<td>
<p>if the given view does not correspond with a <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="findFragmentById-int-"></a><a name="findfragmentbyid"></a>
<h3 class="api-name" id="findFragmentById(int)">findFragmentById</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#findFragmentById(int)">findFragmentById</a>(@<a href="/reference/androidx/annotation/IdRes.html">IdRes</a> int&nbsp;id)</pre>
<p>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.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<p>The fragment if found or null otherwise.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="findFragmentByTag-java.lang.String-"></a><a name="findfragmentbytag"></a>
<h3 class="api-name" id="findFragmentByTag(java.lang.String)">findFragmentByTag</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#findFragmentByTag(java.lang.String)">findFragmentByTag</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;tag)</pre>
<p>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. </p>
<p> If provided a <code>null</code> tag, this method returns null.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;tag</code></td>
<td>
<p>the tag used to search for the fragment</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<p>The fragment if found or null otherwise.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="getBackStackEntryAt-int-"></a><a name="getbackstackentryat"></a>
<h3 class="api-name" id="getBackStackEntryAt(int)">getBackStackEntryAt</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.BackStackEntry.html">FragmentManager.BackStackEntry</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getBackStackEntryAt(int)">getBackStackEntryAt</a>(int&nbsp;index)</pre>
<p>Return the BackStackEntry at index <var>index</var> in the back stack; entries start index 0 being the bottom of the stack.</p>
</div>
<div class="api-item"><a name="getBackStackEntryCount--"></a><a name="getbackstackentrycount"></a>
<h3 class="api-name" id="getBackStackEntryCount()">getBackStackEntryCount</h3>
<pre class="api-signature no-pretty-print">public&nbsp;int&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getBackStackEntryCount()">getBackStackEntryCount</a>()</pre>
<p>Return the number of entries currently in the back stack.</p>
</div>
<div class="api-item"><a name="getFragment(android.os.Bundle, java.lang.String)"></a><a name="getFragment-android.os.Bundle-java.lang.String-"></a><a name="getfragment"></a>
<h3 class="api-name" id="getFragment(android.os.Bundle,java.lang.String)">getFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getFragment(android.os.Bundle,java.lang.String)">getFragment</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key)</pre>
<p>Retrieve the current Fragment instance for a reference previously placed with <code><a href="/reference/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle</code></td>
<td>
<p>The bundle from which to retrieve the fragment reference.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key</code></td>
<td>
<p>The name of the entry in the bundle.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<p>Returns the current Fragment instance that is associated with the given reference.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="getFragmentFactory--"></a><a name="getfragmentfactory"></a>
<h3 class="api-name" id="getFragmentFactory()">getFragmentFactory</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">getFragmentFactory</a>()</pre>
<p>Gets the current <code><a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code> used to instantiate new Fragment instances. </p>
<p> If no factory has been explicitly set on this FragmentManager via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">setFragmentFactory</a></code>, the FragmentFactory of the <code><a href="/reference/androidx/fragment/app/Fragment.html#getParentFragmentManager()">parent FragmentManager</a></code> will be returned.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code></td>
<td>
<p>the current FragmentFactory</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="getFragments--"></a><a name="getfragments"></a>
<h3 class="api-name" id="getFragments()">getFragments</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&gt;&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getFragments()">getFragments</a>()</pre>
<p>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>
<p> The order of the fragments in the list is the order in which they were added or attached.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&gt;</code></td>
<td>
<p>A list of all fragments that are added to the FragmentManager.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="getPrimaryNavigationFragment--"></a><a name="getprimarynavigationfragment"></a>
<h3 class="api-name" id="getPrimaryNavigationFragment()">getPrimaryNavigationFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getPrimaryNavigationFragment()">getPrimaryNavigationFragment</a>()</pre>
<p>Return the currently active primary navigation fragment for this FragmentManager. The primary navigation fragment is set by fragment transactions using <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#setPrimaryNavigationFragment(androidx.fragment.app.Fragment)">setPrimaryNavigationFragment</a></code>. </p>
<p>The primary navigation fragment's <code><a href="/reference/androidx/fragment/app/Fragment.html#getChildFragmentManager()">child FragmentManager</a></code> will be called first to process delegated navigation actions such as <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack()">popBackStack</a></code> if no ID or transaction name is provided to pop to.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td>
<p>the fragment designated as the primary navigation fragment</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="getStrictModePolicy--"></a><a name="getstrictmodepolicy"></a>
<h3 class="api-name" id="getStrictModePolicy()">getStrictModePolicy</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/strictmode/FragmentStrictMode.Policy.html">FragmentStrictMode.Policy</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#getStrictModePolicy()">getStrictModePolicy</a>()</pre>
<p>Returns the current policy for this FragmentManager. If no policy is set, returns null.</p>
</div>
<div class="api-item"><a name="isDestroyed--"></a><a name="isdestroyed"></a>
<h3 class="api-name" id="isDestroyed()">isDestroyed</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#isDestroyed()">isDestroyed</a>()</pre>
<p>Returns true if the final <code><a href="https://developer.android.com/reference/android/app/Activity.html#onDestroy()">Activity.onDestroy()</a></code> call has been made on the FragmentManager's Activity, so this instance is now dead.</p>
</div>
<div class="api-item"><a name="isStateSaved--"></a><a name="isstatesaved"></a>
<h3 class="api-name" id="isStateSaved()">isStateSaved</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#isStateSaved()">isStateSaved</a>()</pre>
<p>Returns <code>true</code> 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 <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate()">popBackStackImmediate</a></code> or any FragmentTransaction using <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commit()">commit</a></code> instead of <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commitAllowingStateLoss()">commitAllowingStateLoss</a></code> will change the state and will result in an error.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<p>true if this FragmentManager's state has already been saved by its host</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="popBackStack--"></a><a name="popbackstack"></a>
<h3 class="api-name" id="popBackStack()">popBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack()">popBackStack</a>()</pre>
<p>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.</p>
</div>
<div class="api-item"><a name="popBackStack(int, int)"></a><a name="popBackStack-int-int-"></a><a name="popbackstack"></a>
<h3 class="api-name" id="popBackStack(int,int)">popBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a>(int&nbsp;id,&nbsp;int&nbsp;flags)</pre>
<p>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.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>int&nbsp;id</code></td>
<td>
<p>Identifier of the stated to be popped. If no identifier exists, false is returned. The identifier is the number returned by <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#commit()">FragmentTransaction.commit()</a></code>. The <code><a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a></code> flag can be used to control whether the named state itself is popped.</p>
</td>
</tr>
<tr>
<td width="40%"><code>int&nbsp;flags</code></td>
<td>
<p>Either 0 or <code><a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="popBackStack(java.lang.String, int)"></a><a name="popBackStack-java.lang.String-int-"></a><a name="popbackstack"></a>
<h3 class="api-name" id="popBackStack(java.lang.String,int)">popBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name,&nbsp;int&nbsp;flags)</pre>
<p>Pop the last fragment transition from the manager's fragment 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.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name</code></td>
<td>
<p>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 <code><a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a></code> flag can be used to control whether the named state itself is popped. If null, only the top state is popped.</p>
</td>
</tr>
<tr>
<td width="40%"><code>int&nbsp;flags</code></td>
<td>
<p>Either 0 or <code><a href="/reference/androidx/fragment/app/FragmentManager.html#POP_BACK_STACK_INCLUSIVE()">POP_BACK_STACK_INCLUSIVE</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="popBackStackImmediate--"></a><a name="popbackstackimmediate"></a>
<h3 class="api-name" id="popBackStackImmediate()">popBackStackImmediate</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate()">popBackStackImmediate</a>()</pre>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack()">popBackStack</a></code>, but performs the operation immediately inside of the call. This is like calling <code><a href="/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">executePendingTransactions</a></code> afterwards without forcing the start of postponed Transactions.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<p>Returns true if there was something popped, else false.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="popBackStackImmediate(int, int)"></a><a name="popBackStackImmediate-int-int-"></a><a name="popbackstackimmediate"></a>
<h3 class="api-name" id="popBackStackImmediate(int,int)">popBackStackImmediate</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate(int,int)">popBackStackImmediate</a>(int&nbsp;id,&nbsp;int&nbsp;flags)</pre>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(int,int)">popBackStack</a></code>, but performs the operation immediately inside of the call. This is like calling <code><a href="/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">executePendingTransactions</a></code> afterwards without forcing the start of postponed Transactions.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<p>Returns true if there was something popped, else false.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="popBackStackImmediate(java.lang.String, int)"></a><a name="popBackStackImmediate-java.lang.String-int-"></a><a name="popbackstackimmediate"></a>
<h3 class="api-name" id="popBackStackImmediate(java.lang.String,int)">popBackStackImmediate</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate(java.lang.String,int)">popBackStackImmediate</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name,&nbsp;int&nbsp;flags)</pre>
<p>Like <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a></code>, but performs the operation immediately inside of the call. This is like calling <code><a href="/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">executePendingTransactions</a></code> afterwards without forcing the start of postponed Transactions.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>boolean</code></td>
<td>
<p>Returns true if there was something popped, else false.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="putFragment(android.os.Bundle, java.lang.String, androidx.fragment.app.Fragment)"></a><a name="putFragment-android.os.Bundle-java.lang.String-androidx.fragment.app.Fragment-"></a><a name="putfragment"></a>
<h3 class="api-name" id="putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment<br>)</pre>
<p>Put a reference to a fragment in a Bundle. This Bundle can be persisted as saved state, and when later restoring <code><a href="/reference/androidx/fragment/app/FragmentManager.html#getFragment(android.os.Bundle,java.lang.String)">getFragment</a></code> will return the current instance of the same fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;bundle</code></td>
<td>
<p>The bundle in which to put the fragment reference.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;key</code></td>
<td>
<p>The name of the entry in the bundle.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment</code></td>
<td>
<p>The Fragment whose reference is to be stored.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks, boolean)"></a><a name="registerFragmentLifecycleCallbacks-androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks-boolean-"></a><a name="registerfragmentlifecyclecallbacks"></a>
<h3 class="api-name" id="registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks,boolean)">registerFragmentLifecycleCallbacks</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks,boolean)">registerFragmentLifecycleCallbacks</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb,<br>&nbsp;&nbsp;&nbsp;&nbsp;boolean&nbsp;recursive<br>)</pre>
<p>Registers a <code><a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentLifecycleCallbacks</a></code> to listen to fragment lifecycle events happening in this FragmentManager. All registered callbacks will be automatically unregistered when this FragmentManager is destroyed.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb</code></td>
<td>
<p>Callbacks to register</p>
</td>
</tr>
<tr>
<td width="40%"><code>boolean&nbsp;recursive</code></td>
<td>
<p>true to automatically register this callback for all child FragmentManagers</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="removeFragmentOnAttachListener-androidx.fragment.app.FragmentOnAttachListener-"></a><a name="removefragmentonattachlistener"></a>
<h3 class="api-name" id="removeFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">removeFragmentOnAttachListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#removeFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">removeFragmentOnAttachListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener<br>)</pre>
<p>Remove a <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a></code> that was previously added via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">addFragmentOnAttachListener</a></code>. It will no longer get called when a new Fragment is attached.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a>&nbsp;listener</code></td>
<td>
<p>Listener to remove</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="removeOnBackStackChangedListener-androidx.fragment.app.FragmentManager.OnBackStackChangedListener-"></a><a name="removeonbackstackchangedlistener"></a>
<h3 class="api-name" id="removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">removeOnBackStackChangedListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">removeOnBackStackChangedListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.OnBackStackChangedListener.html">FragmentManager.OnBackStackChangedListener</a>&nbsp;listener<br>)</pre>
<p>Remove a listener that was previously added with <code><a href="/reference/androidx/fragment/app/FragmentManager.html#addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener)">addOnBackStackChangedListener</a></code>.</p>
</div>
<div class="api-item"><a name="restoreBackStack-java.lang.String-"></a><a name="restorebackstack"></a>
<h3 class="api-name" id="restoreBackStack(java.lang.String)">restoreBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#restoreBackStack(java.lang.String)">restoreBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</pre>
<p>Restores the back stack previously saved via <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>. This will result in all of the transactions that made up that back stack to be re-executed, thus re-adding any fragments that were added through those transactions. All state of those fragments will be restored as part of this process. If no state was previously saved with the given name, this operation does nothing. </p>
<p> This function is asynchronous -- it enqueues the request to restore, but the action will not be performed until the application returns to its event loop.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name</code></td>
<td>
<p>The name of the back stack previously saved by <code><a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="saveBackStack-java.lang.String-"></a><a name="savebackstack"></a>
<h3 class="api-name" id="saveBackStack(java.lang.String)">saveBackStack</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#saveBackStack(java.lang.String)">saveBackStack</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name)</pre>
<p>Save the back stack. While this functions similarly to <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStack(java.lang.String,int)">popBackStack</a></code>, it <b>does not</b> throw away the state of any fragments that were added through those transactions. Instead, the back stack that is saved by this method can later be restored with its state in tact. </p>
<p> 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.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;name</code></td>
<td>
<p>The name set by <code><a href="/reference/androidx/fragment/app/FragmentTransaction.html#addToBackStack(java.lang.String)">addToBackStack</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="saveFragmentInstanceState-androidx.fragment.app.Fragment-"></a><a name="savefragmentinstancestate"></a>
<h3 class="api-name" id="saveFragmentInstanceState(androidx.fragment.app.Fragment)">saveFragmentInstanceState</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#saveFragmentInstanceState(androidx.fragment.app.Fragment)">saveFragmentInstanceState</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment)</pre>
<p>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: </p>
<ul>
<li>The Fragment must currently be attached to the FragmentManager. </li>
<li>A new Fragment created using this saved state must be the same class type as the Fragment it was created from. </li>
<li>The saved state can not contain dependencies on other fragments -- that is it can't use <code><a href="/reference/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">putFragment</a></code> 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. </li>
</ul>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment</code></td>
<td>
<p>The Fragment whose state is to be saved.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Returns</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a></code></td>
<td>
<p>The generated state. This will be null if there was no interesting state created by the fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="setFragmentFactory-androidx.fragment.app.FragmentFactory-"></a><a name="setfragmentfactory"></a>
<h3 class="api-name" id="setFragmentFactory(androidx.fragment.app.FragmentFactory)">setFragmentFactory</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">setFragmentFactory</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a>&nbsp;fragmentFactory)</pre>
<p>Set a <code><a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code> for this FragmentManager that will be used to create new Fragment instances from this point onward. </p>
<p> The <code><a href="/reference/androidx/fragment/app/Fragment.html#getChildFragmentManager()">child FragmentManager</a></code> of all Fragments in this FragmentManager will also use this factory if one is not explicitly set.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a>&nbsp;fragmentFactory</code></td>
<td>
<p>the factory to use to create new Fragment instances</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">See also</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="/reference/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">getFragmentFactory</a></code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="setFragmentResult(java.lang.String, android.os.Bundle)"></a><a name="setFragmentResult-java.lang.String-android.os.Bundle-"></a><a name="setfragmentresult"></a>
<h3 class="api-name" id="setFragmentResult(java.lang.String,android.os.Bundle)">setFragmentResult</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">setFragmentResult</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;result)</pre>
<p>Sets the given result for the requestKey. This result will be delivered to a <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> that is called given to <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</a></code> with the same requestKey. If no <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> with the same key is set or the Lifecycle associated with the listener is not at least <code><a href="/reference/androidx/lifecycle/Lifecycle.State.STARTED.html">STARTED</a></code>, the result is stored until one becomes available, or <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#clearFragmentResult(java.lang.String)">clearFragmentResult</a></code> is called with the same requestKey.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey</code></td>
<td>
<p>key used to identify the result</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/android/os/Bundle.html">Bundle</a>&nbsp;result</code></td>
<td>
<p>the result to be passed to another fragment</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="setFragmentResultListener(java.lang.String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener)"></a><a name="setFragmentResultListener-java.lang.String-androidx.lifecycle.LifecycleOwner-androidx.fragment.app.FragmentResultListener-"></a><a name="setfragmentresultlistener"></a>
<h3 class="api-name" id="setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>&nbsp;lifecycleOwner,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a>&nbsp;listener<br>)</pre>
<p>Sets the <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> for a given requestKey. Once the given <code><a href="/reference/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a></code> is at least in the <code><a href="/reference/androidx/lifecycle/Lifecycle.State.STARTED.html">STARTED</a></code> state, any results set by <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#setFragmentResult(java.lang.String,android.os.Bundle)">setFragmentResult</a></code> using the same requestKey will be delivered to the <code><a href="/reference/androidx/fragment/app/FragmentResultListener.html#onFragmentResult(java.lang.String,android.os.Bundle)">callback</a></code>. The callback will remain active until the LifecycleOwner reaches the <code><a href="/reference/androidx/lifecycle/Lifecycle.State.DESTROYED.html">DESTROYED</a></code> state or <code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#clearFragmentResultListener(java.lang.String)">clearFragmentResultListener</a></code> is called with the same requestKey.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;requestKey</code></td>
<td>
<p>requestKey used to identify the result</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>&nbsp;lifecycleOwner</code></td>
<td>
<p>lifecycleOwner for handling the result</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a>&nbsp;listener</code></td>
<td>
<p>listener for result changes</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="setStrictModePolicy-androidx.fragment.app.strictmode.FragmentStrictMode.Policy-"></a><a name="setstrictmodepolicy"></a>
<h3 class="api-name" id="setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy)">setStrictModePolicy</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy)">setStrictModePolicy</a>(@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/strictmode/FragmentStrictMode.Policy.html">FragmentStrictMode.Policy</a>&nbsp;policy)</pre>
<p>Sets the policy for what actions should be detected, as well as the penalty if such actions occur. The <code><a href="/reference/androidx/fragment/app/Fragment.html#getChildFragmentManager()">child FragmentManager</a></code> of all Fragments in this FragmentManager will also use this policy if one is not explicitly set. Pass null to clear the policy.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a> <a href="/reference/androidx/fragment/app/strictmode/FragmentStrictMode.Policy.html">FragmentStrictMode.Policy</a>&nbsp;policy</code></td>
<td>
<p>the policy to put into place</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="toString--"></a><a name="tostring"></a>
<h3 class="api-name" id="toString()">toString</h3>
<pre class="api-signature no-pretty-print">public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#toString()">toString</a>()</pre>
</div>
<div class="api-item"><a name="unregisterFragmentLifecycleCallbacks-androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks-"></a><a name="unregisterfragmentlifecyclecallbacks"></a>
<h3 class="api-name" id="unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks)">unregisterFragmentLifecycleCallbacks</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentManager.html#unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks)">unregisterFragmentLifecycleCallbacks</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb<br>)</pre>
<p>Unregisters a previously registered <code><a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentLifecycleCallbacks</a></code>. If the callback was not previously registered this call has no effect. All registered callbacks will be automatically unregistered when this FragmentManager is destroyed.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/fragment/app/FragmentManager.FragmentLifecycleCallbacks.html">FragmentManager.FragmentLifecycleCallbacks</a>&nbsp;cb</code></td>
<td>
<p>Callbacks to unregister</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>