blob: 11202e1be1ebbe7ecf01dd8772e7155790f4edf9 [file] [log] [blame]
<html devsite="true">
<head>
<title>Fragment</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>Fragment</h1>
{% setvar page_path %}androidx/fragment/app/Fragment.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>class Fragment</pre>
</p>
<div class="devsite-table-wrapper"><devsite-expandable><span class="expand-control jd-sumtable-subclasses">Known direct subclasses
<div class="showalways" id="subclasses-direct"><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html">DialogFragment</a>, <a href="/reference/kotlin/androidx/fragment/app/ListFragment.html">ListFragment</a></div>
</span>
<div id="subclasses-direct-summary">
<div class="devsite-table-wrapper">
<table class="responsive">
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html">DialogFragment</a></code></td>
<td width="100%">
<p>Static library support version of the framework's android.app.DialogFragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/ListFragment.html">ListFragment</a></code></td>
<td width="100%">
<p>Static library support version of the framework's android.app.ListFragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</devsite-expandable> </div>
<hr>
<p>Static library support version of the framework's android.app.Fragment. 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 android.app.Fragment documentation for a class overview. </p>
<p>The main differences when using this support version instead of the framework version are: </p>
<ul>
<li>Your activity must extend <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code></li>
<li>You must call <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html#getSupportFragmentManager()">FragmentActivity#getSupportFragmentManager</a></code> to get the <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></li>
</ul>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Nested types</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.InstantiationException.html">Fragment.InstantiationException</a></code></td>
<td width="100%">
<p>Thrown by <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html#instantiate(java.lang.ClassLoader,java.lang.String)">FragmentFactory#instantiate(ClassLoader, String)</a></code> when there is an instantiation failure.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a></code></td>
<td width="100%">
<p>State information that has been retrieved from a fragment instance through <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#saveFragmentInstanceState(androidx.fragment.app.Fragment)">FragmentManager#saveFragmentInstanceState(Fragment)</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public constructors</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment()">Fragment</a>()</code></div>
<p>Constructor used by the default <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code>.</p>
</td>
</tr>
<tr>
<td>
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment(int)">Fragment</a>(contentLayoutId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p>Alternate constructor that can be called from your default, no argument constructor to provide a default layout that will be inflated by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public functions</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">dump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;prefix:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fd:&nbsp;<a href="/reference/kotlin/java/io/FileDescriptor.html">FileDescriptor</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;writer:&nbsp;<a href="/reference/kotlin/java/io/PrintWriter.html">PrintWriter</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;args:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;<br>)</code></div>
<p>Print the Fragments's state into the given stream.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#equals(java.lang.Object)">equals</a>(o:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Subclasses can not override equals().</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a>()</code></div>
<p>Return the <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code> this fragment is currently associated with.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getAllowEnterTransitionOverlap()">getAllowEnterTransitionOverlap</a>()</code></div>
<p>Returns whether the the exit transition and enter transition overlap or not.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getAllowReturnTransitionOverlap()">getAllowReturnTransitionOverlap</a>()</code></div>
<p>Returns whether the the return transition and reenter transition overlap or not.</p>
</td>
</tr>
<tr>
<td><code>Bundle</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a>()</code></div>
<p>Return the arguments supplied when the fragment was instantiated, if any.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a>()</code></div>
<p>Return a private FragmentManager for placing and managing Fragments inside of this Fragment.</p>
</td>
</tr>
<tr>
<td><code>Context</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getContext()">getContext</a>()</code></div>
<p>Return the Context this fragment is currently associated with.</p>
</td>
</tr>
<tr>
<td><code>Factory</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getDefaultViewModelProviderFactory()">getDefaultViewModelProviderFactory</a>()</code></div>
<p>{@inheritDoc} </p>
<p>The <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">Fragment's arguments</a></code> when this is first called will be used as the defaults to any androidx.lifecycle.SavedStateHandle passed to a view model created using this factory.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getEnterTransition()">getEnterTransition</a>()</code></div>
<p>Returns the Transition that will be used to move Views into the initial scene.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getExitTransition()">getExitTransition</a>()</code></div>
<p>Returns the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getFragmentManager()">getFragmentManager</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>This has been removed in favor of <code>getParentFragmentManager()</code> which throws an <code><a href="/reference/kotlin/java/lang/IllegalStateException.html">IllegalStateException</a></code> if the FragmentManager is null.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getHost()">getHost</a>()</code></div>
<p>Return the host object of this fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Int.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getId()">getId</a>()</code></div>
<p>Return the identifier this fragment is known by.</p>
</td>
</tr>
<tr>
<td><code>LayoutInflater</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLayoutInflater()">getLayoutInflater</a>()</code></div>
<p>Returns the cached LayoutInflater used to inflate Views of this Fragment.</p>
</td>
</tr>
<tr>
<td><code>Lifecycle</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLifecycle()">getLifecycle</a>()</code></div>
<p>{@inheritDoc} </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
</td>
</tr>
<tr>
<td><code>LoaderManager</code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLoaderManager()">getLoaderManager</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use LoaderManager#getInstance(LifecycleOwner).</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragment()">getParentFragment</a>()</code></div>
<p>Returns the parent Fragment containing this Fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a>()</code></div>
<p>Return the FragmentManager for interacting with fragments associated with this fragment's activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getReenterTransition()">getReenterTransition</a>()</code></div>
<p>Returns the Transition that will be used to move Views in to the scene when returning due to popping a back stack.</p>
</td>
</tr>
<tr>
<td><code>Resources</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getResources()">getResources</a>()</code></div>
<p>Return <code>requireActivity().getResources()</code>.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getRetainInstance()">getRetainInstance</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getReturnTransition()">getReturnTransition</a>()</code></div>
<p>Returns the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack.</p>
</td>
</tr>
<tr>
<td><code>SavedStateRegistry</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSavedStateRegistry()">getSavedStateRegistry</a>()</code></div>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSharedElementEnterTransition()">getSharedElementEnterTransition</a>()</code></div>
<p>Returns the Transition that will be used for shared elements transferred into the content Scene.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSharedElementReturnTransition()">getSharedElementReturnTransition</a>()</code></div>
<p>Return the Transition that will be used for shared elements transferred back during a pop of the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/java/lang/String.html">String</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getString(int)">getString</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p>Return a localized string from the application's package's default string table.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/java/lang/String.html">String</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getString(int,java.lang.Object...)">getString</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;formatArgs:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/kotlin/Any.html">Any</a>&gt;)</code></div>
<p>Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in <code><a href="/reference/kotlin/java/util/Formatter.html">java.util.Formatter</a></code> and format.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/java/lang/String.html">String</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTag()">getTag</a>()</code></div>
<p>Get the tag name of the fragment, if specified.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTargetFragment()">getTargetFragment</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>Instead of using a target fragment to pass results, use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code> to deliver results to <code><a href="/reference/kotlin/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> instances registered by other fragments via <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code>.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Int.html">Int</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTargetRequestCode()">getTargetRequestCode</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>When using the target fragment replacement of <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code>, consider using <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> to pass a <code>{@code requestKey}</code> if you need to support dynamic request keys.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/java/lang/CharSequence.html">CharSequence</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getText(int)">getText</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p>Return a localized, styled CharSequence from the application's package's default string table.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getUserVisibleHint()">getUserVisibleHint</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)">FragmentTransaction#setMaxLifecycle(Fragment, Lifecycle.State)</a></code> instead.</p>
</p>
</td>
</tr>
<tr>
<td><code>View</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">getView</a>()</code></div>
<p>Get the root view for the fragment's layout (the one returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>), if provided.</p>
</td>
</tr>
<tr>
<td><code>LifecycleOwner</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwner()">getViewLifecycleOwner</a>()</code></div>
<p>Get a LifecycleOwner that represents the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">Fragment's View</a></code> lifecycle.</p>
</td>
</tr>
<tr>
<td><code>LiveData&lt;LifecycleOwner&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwnerLiveData()">getViewLifecycleOwnerLiveData</a>()</code></div>
<p>Retrieve a LiveData which allows you to observe the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwner()">lifecycle of the Fragment's View</a></code>.</p>
</td>
</tr>
<tr>
<td><code>ViewModelStore</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewModelStore()">getViewModelStore</a>()</code></div>
<p>Returns the ViewModelStore associated with this Fragment </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Int.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#hashCode()">hashCode</a>()</code></div>
<p>Subclasses can not override hashCode().</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#instantiate(android.content.Context,java.lang.String)">instantiate</a></del></span>(context:&nbsp;Context,&nbsp;fname:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">FragmentManager#getFragmentFactory()</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html#instantiate(java.lang.ClassLoader,java.lang.String)">FragmentFactory#instantiate(ClassLoader, String)</a></code></p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#instantiate(android.content.Context,java.lang.String,android.os.Bundle)">instantiate</a></del></span>(context:&nbsp;Context,&nbsp;fname:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>,&nbsp;args:&nbsp;Bundle)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">FragmentManager#getFragmentFactory()</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html#instantiate(java.lang.ClassLoader,java.lang.String)">FragmentFactory#instantiate(ClassLoader, String)</a></code>, manually calling <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> on the returned Fragment.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isAdded()">isAdded</a>()</code></div>
<p>Return true if the fragment is currently added to its activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isDetached()">isDetached</a>()</code></div>
<p>Return true if the fragment has been explicitly detached from the UI.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isHidden()">isHidden</a>()</code></div>
<p>Return true if the fragment has been hidden.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isInLayout()">isInLayout</a>()</code></div>
<p>Return true if the layout is included as part of an activity view hierarchy via the &lt;fragment&gt; tag.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isRemoving()">isRemoving</a>()</code></div>
<p>Return true if this fragment is currently being removed from its activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isResumed()">isResumed</a>()</code></div>
<p>Return true if the fragment is in the resumed state.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isStateSaved()">isStateSaved</a>()</code></div>
<p>Returns true if this fragment is added and its state has already been saved by its host.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isVisible()">isVisible</a>()</code></div>
<p>Return true if the fragment is currently visible to the user.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityCreated(android.os.Bundle)">onActivityCreated</a></del></span>(savedInstanceState:&nbsp;Bundle)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code> for code touching the Fragment's view and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> for other initialization.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">onActivityResult</a></del></span>(requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;resultCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;data:&nbsp;Intent)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> with the appropriate ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a>(context:&nbsp;Context)</code></div>
<p>Called when a fragment is first attached to its context.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.app.Activity)">onAttach</a></del></span>(activity:&nbsp;Activity)</code></div>
<p><strong>This function is deprecated.</strong>
<p>See <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code>.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttachFragment(androidx.fragment.app.Fragment)">onAttachFragment</a></del></span>(childFragment:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>The responsibility for listening for fragments being attached has been moved to FragmentManager.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onConfigurationChanged(android.content.res.Configuration)">onConfigurationChanged</a>(newConfig:&nbsp;Configuration)</code></div>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onContextItemSelected(android.view.MenuItem)">onContextItemSelected</a>(item:&nbsp;MenuItem)</code></div>
<p>This hook is called whenever an item in a context menu is selected.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a>(savedInstanceState:&nbsp;Bundle)</code></div>
<p>Called to do initial creation of a fragment.</p>
</td>
</tr>
<tr>
<td><code>Animation</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateAnimation(int,boolean,int)">onCreateAnimation</a>(transit:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;enter:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p>Called when a fragment loads an animation.</p>
</td>
</tr>
<tr>
<td><code>Animator</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateAnimator(int,boolean,int)">onCreateAnimator</a>(transit:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;enter:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p>Called when a fragment loads an animator.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)">onCreateContextMenu</a>(menu:&nbsp;ContextMenu,&nbsp;v:&nbsp;View,&nbsp;menuInfo:&nbsp;ContextMenuInfo)</code></div>
<p>Called when a context menu for the <code>{@code view}</code> is about to be shown.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a>(menu:&nbsp;Menu,&nbsp;inflater:&nbsp;MenuInflater)</code></div>
<p>Initialize the contents of the Fragment host's standard options menu.</p>
</td>
</tr>
<tr>
<td><code>View</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;inflater:&nbsp;LayoutInflater,<br>&nbsp;&nbsp;&nbsp;&nbsp;container:&nbsp;ViewGroup,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>)</code></div>
<p>Called to have the fragment instantiate its user interface view.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a>()</code></div>
<p>Called when the fragment is no longer in use.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyOptionsMenu()">onDestroyOptionsMenu</a>()</code></div>
<p>Called when this fragment's option menu items are no longer being included in the overall options menu.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a>()</code></div>
<p>Called when the view previously created by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> has been detached from the fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDetach()">onDetach</a>()</code></div>
<p>Called when the fragment is no longer attached to its activity.</p>
</td>
</tr>
<tr>
<td><code>LayoutInflater</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onGetLayoutInflater(android.os.Bundle)">onGetLayoutInflater</a>(savedInstanceState:&nbsp;Bundle)</code></div>
<p>Returns the LayoutInflater used to inflate Views of this Fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onHiddenChanged(boolean)">onHiddenChanged</a>(hidden:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Called when the hidden state (as returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isHidden()">isHidden</a></code> of the fragment has changed.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)">onInflate</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;context:&nbsp;Context,<br>&nbsp;&nbsp;&nbsp;&nbsp;attrs:&nbsp;AttributeSet,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>)</code></div>
<p>Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle)">onInflate</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;activity:&nbsp;Activity,<br>&nbsp;&nbsp;&nbsp;&nbsp;attrs:&nbsp;AttributeSet,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>See <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)">onInflate</a></code>.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onLowMemory()">onLowMemory</a>()</code></div>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onMultiWindowModeChanged(boolean)">onMultiWindowModeChanged</a>(isInMultiWindowMode:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Called when the Fragment's activity changes from fullscreen mode to multi-window mode and visa-versa.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem)">onOptionsItemSelected</a>(item:&nbsp;MenuItem)</code></div>
<p>This hook is called whenever an item in your options menu is selected.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsMenuClosed(android.view.Menu)">onOptionsMenuClosed</a>(menu:&nbsp;Menu)</code></div>
<p>This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPause()">onPause</a>()</code></div>
<p>Called when the Fragment is no longer resumed.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPictureInPictureModeChanged(boolean)">onPictureInPictureModeChanged</a>(isInPictureInPictureMode:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Called by the system when the activity changes to and from picture-in-picture mode.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu)">onPrepareOptionsMenu</a>(menu:&nbsp;Menu)</code></div>
<p>Prepare the Fragment host's standard options menu to be displayed.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrimaryNavigationFragmentChanged(boolean)">onPrimaryNavigationFragmentChanged</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;isPrimaryNavigationFragment:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a><br>)</code></div>
<p>Callback for when the primary navigation state of this Fragment has changed.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;permissions:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;grantResults:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/kotlin/Int.html">Int</a>&gt;<br>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onResume()">onResume</a>()</code></div>
<p>Called when the fragment is visible to the user and actively running.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onSaveInstanceState(android.os.Bundle)">onSaveInstanceState</a>(outState:&nbsp;Bundle)</code></div>
<p>Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance if its process is restarted.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStart()">onStart</a>()</code></div>
<p>Called when the Fragment is visible to the user.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStop()">onStop</a>()</code></div>
<p>Called when the Fragment is no longer started.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a>(view:&nbsp;View,&nbsp;savedInstanceState:&nbsp;Bundle)</code></div>
<p>Called immediately after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> has returned, but before any saved state has been restored in to the view.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewStateRestored(android.os.Bundle)">onViewStateRestored</a>(savedInstanceState:&nbsp;Bundle)</code></div>
<p>Called when all saved state has been restored into the view hierarchy of the fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition()">postponeEnterTransition</a>()</code></div>
<p>Postpone the entering Fragment transition until <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code> or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">FragmentManager#executePendingTransactions()</a></code> has been called.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition(long,java.util.concurrent.TimeUnit)">postponeEnterTransition</a>(duration:&nbsp;<a href="/reference/kotlin/kotlin/Long.html">Long</a>,&nbsp;timeUnit:&nbsp;<a href="/reference/kotlin/java/util/concurrent/TimeUnit.html">TimeUnit</a>)</code></div>
<p>Postpone the entering Fragment transition for a given amount of time and then call <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code>.</p>
</td>
</tr>
<tr>
<td><code>ActivityResultLauncher&lt;I&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;contract:&nbsp;ActivityResultContract&lt;I, O&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;callback:&nbsp;ActivityResultCallback&lt;O&gt;<br>)</code></div>
<p>{@inheritDoc} </p>
<p>If the host of this fragment is an ActivityResultRegistryOwner the ActivityResultRegistry of the host will be used.</p>
</td>
</tr>
<tr>
<td><code>ActivityResultLauncher&lt;I&gt;</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;contract:&nbsp;ActivityResultContract&lt;I, O&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;registry:&nbsp;ActivityResultRegistry,<br>&nbsp;&nbsp;&nbsp;&nbsp;callback:&nbsp;ActivityResultCallback&lt;O&gt;<br>)</code></div>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForContextMenu(android.view.View)">registerForContextMenu</a>(view:&nbsp;View)</code></div>
<p>Registers a context menu to be shown for the given view (multiple views can show the context menu).</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></del></span>(permissions:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireActivity()">requireActivity</a>()</code></div>
<p>Return the <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code> this fragment is currently associated with.</p>
</td>
</tr>
<tr>
<td><code>Bundle</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireArguments()">requireArguments</a>()</code></div>
<p>Return the arguments supplied when the fragment was instantiated.</p>
</td>
</tr>
<tr>
<td><code>Context</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireContext()">requireContext</a>()</code></div>
<p>Return the Context this fragment is currently associated with.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireFragmentManager()">requireFragmentManager</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>This has been renamed to <code>getParentFragmentManager()</code> to make it clear that you are accessing the FragmentManager that contains this Fragment and not the FragmentManager associated with child Fragments.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireHost()">requireHost</a>()</code></div>
<p>Return the host object of this fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireParentFragment()">requireParentFragment</a>()</code></div>
<p>Returns the parent Fragment containing this Fragment.</p>
</td>
</tr>
<tr>
<td><code>View</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireView()">requireView</a>()</code></div>
<p>Get the root view for the fragment's layout (the one returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>).</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setAllowEnterTransitionOverlap(boolean)">setAllowEnterTransitionOverlap</a>(allow:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Sets whether the the exit transition and enter transition overlap or not.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setAllowReturnTransitionOverlap(boolean)">setAllowReturnTransitionOverlap</a>(allow:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Sets whether the the return transition and reenter transition overlap or not.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a>(args:&nbsp;Bundle)</code></div>
<p>Supply the construction arguments for this fragment.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)">setEnterSharedElementCallback</a>(callback:&nbsp;SharedElementCallback)</code></div>
<p>When custom transitions are used with Fragments, the enter transition callback is called when this Fragment is attached or detached when not popping the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setEnterTransition(java.lang.Object)">setEnterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used to move Views into the initial scene.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setExitSharedElementCallback(androidx.core.app.SharedElementCallback)">setExitSharedElementCallback</a>(callback:&nbsp;SharedElementCallback)</code></div>
<p>When custom transitions are used with Fragments, the exit transition callback is called when this Fragment is attached or detached when popping the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setExitTransition(java.lang.Object)">setExitTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a>(hasMenu:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Report that this fragment would like to participate in populating the options menu by receiving a call to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code> and related methods.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setInitialSavedState(androidx.fragment.app.Fragment.SavedState)">setInitialSavedState</a>(state:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a>)</code></div>
<p>Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#saveFragmentInstanceState(androidx.fragment.app.Fragment)">FragmentManager#saveFragmentInstanceState(Fragment)</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setMenuVisibility(boolean)">setMenuVisibility</a>(menuVisible:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p>Set a hint for whether this fragment's menu should be visible.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setReenterTransition(java.lang.Object)">setReenterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used to move Views in to the scene when returning due to popping a back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setRetainInstance(boolean)">setRetainInstance</a></del></span>(retain:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setReturnTransition(java.lang.Object)">setReturnTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementEnterTransition(java.lang.Object)">setSharedElementEnterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used for shared elements transferred into the content Scene.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementReturnTransition(java.lang.Object)">setSharedElementReturnTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>)</code></div>
<p>Sets the Transition that will be used for shared elements transferred back during a pop of the back stack.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setTargetFragment(androidx.fragment.app.Fragment,int)">setTargetFragment</a></del></span>(fragment:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Instead of using a target fragment to pass results, the fragment requesting a result should use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code> to register a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> with a <code>{@code * requestKey}</code> using its <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">parent fragment manager</a></code>.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">setUserVisibleHint</a></del></span>(isVisibleToUser:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>If you are manually calling this method, use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)">FragmentTransaction#setMaxLifecycle(Fragment, Lifecycle.State)</a></code> instead.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String)">shouldShowRequestPermissionRationale</a>(permission:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>)</code></div>
<p>Gets whether you should show UI with rationale before requesting a permission.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivity(android.content.Intent)">startActivity</a>(intent:&nbsp;Intent)</code></div>
<p>Call Activity#startActivity(Intent) from the fragment's containing Activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivity(android.content.Intent,android.os.Bundle)">startActivity</a>(intent:&nbsp;Intent,&nbsp;options:&nbsp;Bundle)</code></div>
<p>Call Activity#startActivity(Intent, Bundle) from the fragment's containing Activity.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivityForResult(android.content.Intent,int)">startActivityForResult</a></del></span>(intent:&nbsp;Intent,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartActivityForResult object for the ActivityResultContract.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivityForResult(android.content.Intent,int,android.os.Bundle)">startActivityForResult</a></del></span>(intent:&nbsp;Intent,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;options:&nbsp;Bundle)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartActivityForResult object for the ActivityResultContract.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">startIntentSenderForResult</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;intent:&nbsp;IntentSender,<br>&nbsp;&nbsp;&nbsp;&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fillInIntent:&nbsp;Intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsMask:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsValues:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;extraFlags:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;options:&nbsp;Bundle<br>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartIntentSenderForResult object for the ActivityResultContract.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a>()</code></div>
<p>Begin postponed transitions after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition()">postponeEnterTransition</a></code> was called.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/java/lang/String.html">String</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#toString()">toString</a>()</code></div>
</td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Unit.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#unregisterForContextMenu(android.view.View)">unregisterForContextMenu</a>(view:&nbsp;View)</code></div>
<p>Prevents a context menu to be shown for the given view.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public constructors</h2>
<div><a name="Fragment--"></a>
<h3 class="api-name" id="Fragment()">Fragment</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment()">Fragment</a>()</pre>
<p>Constructor used by the default <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html">FragmentFactory</a></code>. You must <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">FragmentManager#setFragmentFactory(FragmentFactory)</a></code> if you want to use a non-default constructor to ensure that your constructor is called when the fragment is re-instantiated. </p>
<p>It is strongly recommended to supply arguments with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> and later retrieved by the Fragment with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a></code>. These arguments are automatically saved and restored alongside the Fragment. </p>
<p>Applications should generally not implement a constructor. Prefer <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code> instead. It is the first place application code can run where the fragment is ready to be used - the point where the fragment is actually associated with its context. Some applications may also want to implement onInflate to retrieve attributes from a layout resource, although note this happens when the fragment is attached.</p>
</div>
<div><a name="Fragment-int-"></a>
<h3 class="api-name" id="Fragment(int)">Fragment</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment(int)">Fragment</a>(contentLayoutId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>)</pre>
<p>Alternate constructor that can be called from your default, no argument constructor to provide a default layout that will be inflated by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>. </p>
<pre class="prettyprint">class MyFragment extends Fragment {
public MyFragment() {
super(R.layout.fragment_main);
}
}
</pre>
You must <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">FragmentManager#setFragmentFactory(FragmentFactory)</a></code> if you want to use a non-default constructor to ensure that your constructor is called when the fragment is re-instantiated.
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment()">Fragment</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment()">Fragment</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public functions</h2>
<div><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>
<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">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">dump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;prefix:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fd:&nbsp;<a href="/reference/kotlin/java/io/FileDescriptor.html">FileDescriptor</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;writer:&nbsp;<a href="/reference/kotlin/java/io/PrintWriter.html">PrintWriter</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;args:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;<br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Print the Fragments's state into the given stream.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>prefix</code></td>
<td width="100%">
<p>Text to print at the front of each line.</p>
</td>
</tr>
<tr>
<td><code>fd</code></td>
<td width="100%">
<p>The raw file descriptor that the dump is being sent to.</p>
</td>
</tr>
<tr>
<td><code>writer</code></td>
<td width="100%">
<p>The PrintWriter to which you should dump your state. This will be closed for you after you return.</p>
</td>
</tr>
<tr>
<td><code>args</code></td>
<td width="100%">
<p>additional arguments to the dump request.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="equals-java.lang.Object-"></a>
<h3 class="api-name" id="equals(java.lang.Object)">equals</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#equals(java.lang.Object)">equals</a>(o:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Subclasses can not override equals().</p>
</div>
<div><a name="getActivity--"></a>
<h3 class="api-name" id="getActivity()">getActivity</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></pre>
<p>Return the <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code> this fragment is currently associated with. May return <code>{@code null}</code> if the fragment is associated with a Context instead.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireActivity()">requireActivity</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireActivity()">requireActivity</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getAllowEnterTransitionOverlap--"></a>
<h3 class="api-name" id="getAllowEnterTransitionOverlap()">getAllowEnterTransitionOverlap</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getAllowEnterTransitionOverlap()">getAllowEnterTransitionOverlap</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Returns whether the the exit transition and enter transition overlap or not. When true, the enter transition will start as soon as possible. When false, the enter transition will wait until the exit transition completes before starting.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>true when the enter transition should start as soon as possible or false to when it should wait until the exiting transition completes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getAllowReturnTransitionOverlap--"></a>
<h3 class="api-name" id="getAllowReturnTransitionOverlap()">getAllowReturnTransitionOverlap</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getAllowReturnTransitionOverlap()">getAllowReturnTransitionOverlap</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Returns whether the the return transition and reenter transition overlap or not. When true, the reenter transition will start as soon as possible. When false, the reenter transition will wait until the return transition completes before starting.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>true to start the reenter transition when possible or false to wait until the return transition completes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getArguments--"></a>
<h3 class="api-name" id="getArguments()">getArguments</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a>():&nbsp;Bundle</pre>
<p>Return the arguments supplied when the fragment was instantiated, if any.</p>
</div>
<div><a name="getChildFragmentManager--"></a>
<h3 class="api-name" id="getChildFragmentManager()">getChildFragmentManager</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></pre>
<p>Return a private FragmentManager for placing and managing Fragments inside of this Fragment.</p>
</div>
<div><a name="getContext--"></a>
<h3 class="api-name" id="getContext()">getContext</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getContext()">getContext</a>():&nbsp;Context</pre>
<p>Return the Context this fragment is currently associated with.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireContext()">requireContext</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireContext()">requireContext</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getDefaultViewModelProviderFactory--"></a>
<h3 class="api-name" id="getDefaultViewModelProviderFactory()">getDefaultViewModelProviderFactory</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getDefaultViewModelProviderFactory()">getDefaultViewModelProviderFactory</a>():&nbsp;Factory</pre>
<p>{@inheritDoc} </p>
<p>The <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">Fragment's arguments</a></code> when this is first called will be used as the defaults to any androidx.lifecycle.SavedStateHandle passed to a view model created using this factory.</p>
</div>
<div><a name="getEnterTransition--"></a>
<h3 class="api-name" id="getEnterTransition()">getEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getEnterTransition()">getEnterTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Returns the Transition that will be used to move Views into the initial scene. The entering Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as entering is governed by changing visibility from View#INVISIBLE to View#VISIBLE.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>the Transition to use to move Views into the initial Scene.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getExitTransition--"></a>
<h3 class="api-name" id="getExitTransition()">getExitTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getExitTransition()">getExitTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Returns the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack. The exiting Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as exiting is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If transition is null, the views will remain unaffected.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>the Transition to use to move Views out of the Scene when the Fragment is being closed not due to popping the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getFragmentManager--"></a>
<h3 class="api-name" id="getFragmentManager()">getFragmentManager</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getFragmentManager()">getFragmentManager</a></del></span>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>This has been removed in favor of <code>getParentFragmentManager()</code> which throws an <code><a href="/reference/kotlin/java/lang/IllegalStateException.html">IllegalStateException</a></code> if the FragmentManager is null. Check if <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isAdded()">isAdded</a></code> returns <code>false</code> to determine if the FragmentManager is <code>null</code>.</p>
</aside>
<p>Return the FragmentManager for interacting with fragments associated with this fragment's activity. Note that this will be non-null slightly before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a></code>, during the time from when the fragment is placed in a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code> until it is committed and attached to its activity. </p>
<p>If this Fragment is a child of another Fragment, the FragmentManager returned here will be the parent's <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getHost--"></a>
<h3 class="api-name" id="getHost()">getHost</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getHost()">getHost</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Return the host object of this fragment. May return <code>{@code null}</code> if the fragment isn't currently being hosted.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireHost()">requireHost</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireHost()">requireHost</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getId--"></a>
<h3 class="api-name" id="getId()">getId</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getId()">getId</a>():&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a></pre>
<p>Return the identifier this fragment is known by. This is either the android:id value supplied in a layout or the container view ID supplied when adding the fragment.</p>
</div>
<div><a name="getLayoutInflater--"></a>
<h3 class="api-name" id="getLayoutInflater()">getLayoutInflater</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLayoutInflater()">getLayoutInflater</a>():&nbsp;LayoutInflater</pre>
<p>Returns the cached LayoutInflater used to inflate Views of this Fragment. If <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onGetLayoutInflater(android.os.Bundle)">onGetLayoutInflater</a></code> has not been called <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onGetLayoutInflater(android.os.Bundle)">onGetLayoutInflater</a></code> will be called with a <code>{@code null}</code> argument and that value will be cached. </p>
<p>The cached LayoutInflater will be replaced immediately prior to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> and cleared immediately after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDetach()">onDetach</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>LayoutInflater</code></td>
<td width="100%">
<p>The LayoutInflater used to inflate Views of this Fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getLifecycle--"></a>
<h3 class="api-name" id="getLifecycle()">getLifecycle</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLifecycle()">getLifecycle</a>():&nbsp;Lifecycle</pre>
<p>{@inheritDoc} </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
</div>
<div><a name="getLoaderManager--"></a>
<h3 class="api-name" id="getLoaderManager()">getLoaderManager</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getLoaderManager()">getLoaderManager</a></del></span>():&nbsp;LoaderManager</pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use LoaderManager#getInstance(LifecycleOwner).</p>
</aside>
<p>Return the LoaderManager for this fragment.</p>
</div>
<div><a name="getParentFragment--"></a>
<h3 class="api-name" id="getParentFragment()">getParentFragment</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragment()">getParentFragment</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<p>Returns the parent Fragment containing this Fragment. If this Fragment is attached directly to an Activity, returns null.</p>
</div>
<div><a name="getParentFragmentManager--"></a>
<h3 class="api-name" id="getParentFragmentManager()">getParentFragmentManager</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></pre>
<p>Return the FragmentManager for interacting with fragments associated with this fragment's activity. Note that this will available slightly before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a></code>, during the time from when the fragment is placed in a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code> until it is committed and attached to its activity. </p>
<p>If this Fragment is a child of another Fragment, the FragmentManager returned here will be the parent's <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if not associated with a transaction or host.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getReenterTransition--"></a>
<h3 class="api-name" id="getReenterTransition()">getReenterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getReenterTransition()">getReenterTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Returns the Transition that will be used to move Views in to the scene when returning due to popping a back stack. The entering Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as exiting is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If nothing is set, the default will be to use the same transition as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getExitTransition()">getExitTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>the Transition to use to move Views into the scene when reentering from a previously-started Activity due to popping the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getResources--"></a>
<h3 class="api-name" id="getResources()">getResources</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getResources()">getResources</a>():&nbsp;Resources</pre>
<p>Return <code>requireActivity().getResources()</code>.</p>
</div>
<div><a name="getRetainInstance--"></a>
<h3 class="api-name" id="getRetainInstance()">getRetainInstance</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getRetainInstance()">getRetainInstance</a></del></span>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment. The ViewModel's constructor and its onCleared() callback provide the signal for initial creation and final destruction of the retained state.</p>
</aside>
<p>Returns <code>true</code> if this fragment instance's state will be retained across configuration changes, and <code>false</code> if it will not.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>whether or not this fragment instance will be retained.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setRetainInstance(boolean)">setRetainInstance</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setRetainInstance(boolean)">setRetainInstance</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getReturnTransition--"></a>
<h3 class="api-name" id="getReturnTransition()">getReturnTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getReturnTransition()">getReturnTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Returns the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack. The exiting Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as entering is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If nothing is set, the default will be to use the same transition as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getEnterTransition()">getEnterTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>the Transition to use to move Views out of the Scene when the Fragment is preparing to close due to popping the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getSavedStateRegistry--"></a>
<h3 class="api-name" id="getSavedStateRegistry()">getSavedStateRegistry</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSavedStateRegistry()">getSavedStateRegistry</a>():&nbsp;SavedStateRegistry</pre>
</div>
<div><a name="getSharedElementEnterTransition--"></a>
<h3 class="api-name" id="getSharedElementEnterTransition()">getSharedElementEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSharedElementEnterTransition()">getSharedElementEnterTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Returns the Transition that will be used for shared elements transferred into the content Scene. Typical Transitions will affect size and location, such as android.transition.ChangeBounds. A null value will cause transferred shared elements to blink to the final position.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>The Transition to use for shared elements transferred into the content Scene.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getSharedElementReturnTransition--"></a>
<h3 class="api-name" id="getSharedElementReturnTransition()">getSharedElementReturnTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getSharedElementReturnTransition()">getSharedElementReturnTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Return the Transition that will be used for shared elements transferred back during a pop of the back stack. This Transition acts in the leaving Fragment. Typical Transitions will affect size and location, such as android.transition.ChangeBounds. A null value will cause transferred shared elements to blink to the final position. If no value is set, the default will be to use the same value as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementEnterTransition(java.lang.Object)">setSharedElementEnterTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Any.html">Any</a></code></td>
<td width="100%">
<p>The Transition to use for shared elements transferred out of the content Scene.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getString-int-"></a>
<h3 class="api-name" id="getString(int)">getString</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getString(int)">getString</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a></pre>
<p>Return a localized string from the application's package's default string table.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resId</code></td>
<td width="100%">
<p>Resource id for the string</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getString(int, java.lang.Object...)"></a><a name="getString-int-java.lang.Object...-"></a>
<h3 class="api-name" id="getString(int,java.lang.Object...)">getString</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getString(int,java.lang.Object...)">getString</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;formatArgs:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/kotlin/Any.html">Any</a>&gt;):&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a></pre>
<p>Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in <code><a href="/reference/kotlin/java/util/Formatter.html">java.util.Formatter</a></code> and format.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resId</code></td>
<td width="100%">
<p>Resource id for the format string</p>
</td>
</tr>
<tr>
<td><code>formatArgs</code></td>
<td width="100%">
<p>The format arguments that will be used for substitution.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getTag--"></a>
<h3 class="api-name" id="getTag()">getTag</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTag()">getTag</a>():&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a></pre>
<p>Get the tag name of the fragment, if specified.</p>
</div>
<div><a name="getTargetFragment--"></a>
<h3 class="api-name" id="getTargetFragment()">getTargetFragment</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTargetFragment()">getTargetFragment</a></del></span>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Instead of using a target fragment to pass results, use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code> to deliver results to <code><a href="/reference/kotlin/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> instances registered by other fragments via <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code>.</p>
</aside>
<p>Return the target fragment set by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setTargetFragment(androidx.fragment.app.Fragment,int)">setTargetFragment</a></code>.</p>
</div>
<div><a name="getTargetRequestCode--"></a>
<h3 class="api-name" id="getTargetRequestCode()">getTargetRequestCode</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getTargetRequestCode()">getTargetRequestCode</a></del></span>():&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>When using the target fragment replacement of <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code>, consider using <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> to pass a <code>{@code requestKey}</code> if you need to support dynamic request keys.</p>
</aside>
<p>Return the target request code set by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setTargetFragment(androidx.fragment.app.Fragment,int)">setTargetFragment</a></code>.</p>
</div>
<div><a name="getText-int-"></a>
<h3 class="api-name" id="getText(int)">getText</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getText(int)">getText</a>(resId:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;<a href="/reference/kotlin/java/lang/CharSequence.html">CharSequence</a></pre>
<p>Return a localized, styled CharSequence from the application's package's default string table.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resId</code></td>
<td width="100%">
<p>Resource id for the CharSequence text</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getUserVisibleHint--"></a>
<h3 class="api-name" id="getUserVisibleHint()">getUserVisibleHint</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getUserVisibleHint()">getUserVisibleHint</a></del></span>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)">FragmentTransaction#setMaxLifecycle(Fragment, Lifecycle.State)</a></code> instead.</p>
</aside>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>The current value of the user-visible hint on this fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">setUserVisibleHint</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">setUserVisibleHint</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getView--"></a>
<h3 class="api-name" id="getView()">getView</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">getView</a>():&nbsp;View</pre>
<p>Get the root view for the fragment's layout (the one returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>), if provided.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>View</code></td>
<td width="100%">
<p>The fragment's root view, or null if it has no layout.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getViewLifecycleOwner--"></a>
<h3 class="api-name" id="getViewLifecycleOwner()">getViewLifecycleOwner</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwner()">getViewLifecycleOwner</a>():&nbsp;LifecycleOwner</pre>
<p>Get a LifecycleOwner that represents the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">Fragment's View</a></code> lifecycle. In most cases, this mirrors the lifecycle of the Fragment itself, but in cases of <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#detach(androidx.fragment.app.Fragment)">FragmentTransaction#detach(Fragment)</a></code> Fragments, the lifecycle of the Fragment can be considerably longer than the lifecycle of the View itself. </p>
<p>Namely, the lifecycle of the Fragment's View is: </p>
<ol>
<li>Lifecycle.Event#ON_CREATE after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewStateRestored(android.os.Bundle)">onViewStateRestored</a></code></li>
<li>Lifecycle.Event#ON_START after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStart()">onStart</a></code></li>
<li>Lifecycle.Event#ON_RESUME after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onResume()">onResume</a></code></li>
<li>Lifecycle.Event#ON_PAUSE before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPause()">onPause</a></code></li>
<li>Lifecycle.Event#ON_STOP before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStop()">onStop</a></code></li>
<li>Lifecycle.Event#ON_DESTROY before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a></code></li>
</ol>
The first method where it is safe to access the view lifecycle is <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> under the condition that you must return a non-null view (an IllegalStateException will be thrown if you access the view lifecycle but don't return a non-null view).
<p>The view lifecycle remains valid through the call to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a></code>, after which <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">getView</a></code> will return null, the view lifecycle will be destroyed, and this method will throw an IllegalStateException. Consider using <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwnerLiveData()">getViewLifecycleOwnerLiveData</a></code> or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#runOnCommit(java.lang.Runnable)">FragmentTransaction#runOnCommit(Runnable)</a></code> to receive a callback for when the Fragment's view lifecycle is available. </p>
<p>This should only be called on the main thread. </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>LifecycleOwner</code></td>
<td width="100%">
<p>A LifecycleOwner that represents the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">Fragment's View</a></code> lifecycle.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">Fragment's View is null</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getViewLifecycleOwnerLiveData--"></a>
<h3 class="api-name" id="getViewLifecycleOwnerLiveData()">getViewLifecycleOwnerLiveData</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwnerLiveData()">getViewLifecycleOwnerLiveData</a>():&nbsp;LiveData&lt;LifecycleOwner&gt;</pre>
<p>Retrieve a LiveData which allows you to observe the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwner()">lifecycle of the Fragment's View</a></code>. </p>
<p>This will be set to the new LifecycleOwner after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> returns a non-null View and will set to null after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a></code>. </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>LiveData&lt;LifecycleOwner&gt;</code></td>
<td width="100%">
<p>A LiveData that changes in sync with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewLifecycleOwner()">getViewLifecycleOwner</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getViewModelStore--"></a>
<h3 class="api-name" id="getViewModelStore()">getViewModelStore</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getViewModelStore()">getViewModelStore</a>():&nbsp;ViewModelStore</pre>
<p>Returns the ViewModelStore associated with this Fragment </p>
<p>Overriding this method is no longer supported and this method will be made <code>final</code> in a future version of Fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ViewModelStore</code></td>
<td width="100%">
<p>a <code>{@code ViewModelStore}</code></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if called before the Fragment is attached i.e., before onAttach().</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="hashCode--"></a>
<h3 class="api-name" id="hashCode()">hashCode</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#hashCode()">hashCode</a>():&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a></pre>
<p>Subclasses can not override hashCode().</p>
</div>
<div><a name="instantiate(android.content.Context, java.lang.String)"></a><a name="instantiate-android.content.Context-java.lang.String-"></a>
<h3 class="api-name" id="instantiate(android.content.Context,java.lang.String)">instantiate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#instantiate(android.content.Context,java.lang.String)">instantiate</a></del></span>(context:&nbsp;Context,&nbsp;fname:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>):&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">FragmentManager#getFragmentFactory()</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html#instantiate(java.lang.ClassLoader,java.lang.String)">FragmentFactory#instantiate(ClassLoader, String)</a></code></p>
</aside>
<p>Like <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#instantiate(android.content.Context,java.lang.String,android.os.Bundle)">instantiate</a></code> but with a null argument Bundle.</p>
</div>
<div><a name="instantiate(android.content.Context, java.lang.String, android.os.Bundle)"></a><a name="instantiate-android.content.Context-java.lang.String-android.os.Bundle-"></a>
<h3 class="api-name" id="instantiate(android.content.Context,java.lang.String,android.os.Bundle)">instantiate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#instantiate(android.content.Context,java.lang.String,android.os.Bundle)">instantiate</a></del></span>(context:&nbsp;Context,&nbsp;fname:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>,&nbsp;args:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#getFragmentFactory()">FragmentManager#getFragmentFactory()</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentFactory.html#instantiate(java.lang.ClassLoader,java.lang.String)">FragmentFactory#instantiate(ClassLoader, String)</a></code>, manually calling <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> on the returned Fragment.</p>
</aside>
<p>Create a new instance of a Fragment with the given class name. This is the same as calling its empty constructor, setting the <code><a href="/reference/kotlin/java/lang/ClassLoader.html">ClassLoader</a></code> on the supplied arguments, then calling <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<p>Returns a new fragment instance.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>context</code></td>
<td width="100%">
<p>The calling context being used to instantiate the fragment. This is currently just used to get its ClassLoader.</p>
</td>
</tr>
<tr>
<td><code>fname</code></td>
<td width="100%">
<p>The class name of the fragment to instantiate.</p>
</td>
</tr>
<tr>
<td><code>args</code></td>
<td width="100%">
<p>Bundle of arguments to supply to the fragment, which it can retrieve with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a></code>. May be null.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>androidx.fragment.app.Fragment.InstantiationException</code></td>
<td width="100%">
<p>If there is a failure in instantiating the given fragment class. This is a runtime exception; it is not normally expected to happen.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="isAdded--"></a>
<h3 class="api-name" id="isAdded()">isAdded</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isAdded()">isAdded</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the fragment is currently added to its activity.</p>
</div>
<div><a name="isDetached--"></a>
<h3 class="api-name" id="isDetached()">isDetached</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isDetached()">isDetached</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the fragment has been explicitly detached from the UI. That is, <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#detach(androidx.fragment.app.Fragment)">FragmentTransaction#detach(Fragment)</a></code> has been used on it.</p>
</div>
<div><a name="isHidden--"></a>
<h3 class="api-name" id="isHidden()">isHidden</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isHidden()">isHidden</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the fragment has been hidden. By default fragments are shown. You can find out about changes to this state with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onHiddenChanged(boolean)">onHiddenChanged</a></code>. Note that the hidden state is orthogonal to other states -- that is, to be visible to the user, a fragment must be both started and not hidden.</p>
</div>
<div><a name="isInLayout--"></a>
<h3 class="api-name" id="isInLayout()">isInLayout</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isInLayout()">isInLayout</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the layout is included as part of an activity view hierarchy via the &lt;fragment&gt; tag. This will always be true when fragments are created through the &lt;fragment&gt; tag, <em>except</em>in the case where an old fragment is restored from a previous state and it does not appear in the layout of the current state.</p>
</div>
<div><a name="isRemoving--"></a>
<h3 class="api-name" id="isRemoving()">isRemoving</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isRemoving()">isRemoving</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if this fragment is currently being removed from its activity. This is <em>not</em> whether its activity is finishing, but rather whether it is in the process of being removed from its activity.</p>
</div>
<div><a name="isResumed--"></a>
<h3 class="api-name" id="isResumed()">isResumed</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isResumed()">isResumed</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the fragment is in the resumed state. This is true for the duration of <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onResume()">onResume</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPause()">onPause</a></code> as well.</p>
</div>
<div><a name="isStateSaved--"></a>
<h3 class="api-name" id="isStateSaved()">isStateSaved</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isStateSaved()">isStateSaved</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Returns true if this fragment is added and its state has already been saved by its host. Any operations that would change saved state should not be performed if this method returns true, and some operations such as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> will fail.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>true if this fragment's state has already been saved by its host</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="isVisible--"></a>
<h3 class="api-name" id="isVisible()">isVisible</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isVisible()">isVisible</a>():&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Return true if the fragment is currently visible to the user. This means it: (1) has been added, (2) has its view attached to the window, and (3) is not hidden.</p>
</div>
<div><a name="onActivityCreated-android.os.Bundle-"></a>
<h3 class="api-name" id="onActivityCreated(android.os.Bundle)">onActivityCreated</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityCreated(android.os.Bundle)">onActivityCreated</a></del></span>(savedInstanceState:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code> for code touching the Fragment's view and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> for other initialization. To get a callback specifically when a Fragment activity's Activity#onCreate(Bundle) is called, register a androidx.lifecycle.LifecycleObserver on the Activity's Lifecycle in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code>, removing it when it receives the Lifecycle.State#CREATED callback.</p>
</aside>
<p>Called when the fragment's activity has been created and this fragment's view hierarchy instantiated. It can be used to do final initialization once these pieces are in place, such as retrieving views or restoring state. It is also useful for fragments that use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setRetainInstance(boolean)">setRetainInstance</a></code> to retain their instance, as this callback tells the fragment when it is fully associated with the new activity instance. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> and before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewStateRestored(android.os.Bundle)">onViewStateRestored</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If the fragment is being re-created from a previous saved state, this is the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onActivityResult(int, int, android.content.Intent)"></a><a name="onActivityResult-int-int-android.content.Intent-"></a>
<h3 class="api-name" id="onActivityResult(int,int,android.content.Intent)">onActivityResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">onActivityResult</a></del></span>(requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;resultCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;data:&nbsp;Intent):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> with the appropriate ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</aside>
<p>Receive the result from a previous call to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivityForResult(android.content.Intent,int)">startActivityForResult</a></code>. This follows the related Activity API as described there in Activity#onActivityResult(int, int, Intent).</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from.</p>
</td>
</tr>
<tr>
<td><code>resultCode</code></td>
<td width="100%">
<p>The integer result code returned by the child activity through its setResult().</p>
</td>
</tr>
<tr>
<td><code>data</code></td>
<td width="100%">
<p>An Intent, which can return result data to the caller (various data can be attached to Intent &quot;extras&quot;).</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onAttach-android.content.Context-"></a>
<h3 class="api-name" id="onAttach(android.content.Context)">onAttach</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a>(context:&nbsp;Context):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when a fragment is first attached to its context. <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> will be called after this.</p>
</div>
<div><a name="onAttach-android.app.Activity-"></a>
<h3 class="api-name" id="onAttach(android.app.Activity)">onAttach</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.app.Activity)">onAttach</a></del></span>(activity:&nbsp;Activity):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>See <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code>.</p>
</aside>
<p>Called when a fragment is first attached to its activity. <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> will be called after this.</p>
</div>
<div><a name="onAttachFragment-androidx.fragment.app.Fragment-"></a>
<h3 class="api-name" id="onAttachFragment(androidx.fragment.app.Fragment)">onAttachFragment</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttachFragment(androidx.fragment.app.Fragment)">onAttachFragment</a></del></span>(childFragment:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>The responsibility for listening for fragments being attached has been moved to FragmentManager. You can add a listener to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a></code> the child FragmentManager} by calling <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">FragmentManager#addFragmentOnAttachListener(FragmentOnAttachListener)</a></code> in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code> to get callbacks when a child fragment is attached.</p>
</aside>
<p>Called when a fragment is attached as a child of this fragment. </p>
<p>This is called after the attached fragment's <code>onAttach</code> and before the attached fragment's <code>onCreate</code> if the fragment has not yet had a previous call to <code>onCreate</code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>childFragment</code></td>
<td width="100%">
<p>child fragment being attached</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onConfigurationChanged-android.content.res.Configuration-"></a>
<h3 class="api-name" id="onConfigurationChanged(android.content.res.Configuration)">onConfigurationChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onConfigurationChanged(android.content.res.Configuration)">onConfigurationChanged</a>(newConfig:&nbsp;Configuration):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
</div>
<div><a name="onContextItemSelected-android.view.MenuItem-"></a>
<h3 class="api-name" id="onContextItemSelected(android.view.MenuItem)">onContextItemSelected</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onContextItemSelected(android.view.MenuItem)">onContextItemSelected</a>(item:&nbsp;MenuItem):&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>This hook is called whenever an item in a context menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities. </p>
<p>Use MenuItem#getMenuInfo() to get extra information set by the View that added this menu item. </p>
<p>Derived classes should call through to the base class for it to perform the default menu handling.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>boolean Return false to allow normal context menu processing to proceed, true to consume it here.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>item</code></td>
<td width="100%">
<p>The context menu item that was selected.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onCreate-android.os.Bundle-"></a>
<h3 class="api-name" id="onCreate(android.os.Bundle)">onCreate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a>(savedInstanceState:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called to do initial creation of a fragment. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.app.Activity)">onAttach</a></code> and before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>. </p>
<p>Note that this can be called while the fragment's activity is still in the process of being created. As such, you can not rely on things like the activity's content view hierarchy being initialized at this point. If you want to do work once the activity itself is created, add a androidx.lifecycle.LifecycleObserver on the activity's Lifecycle, removing it when it receives the Lifecycle.State#CREATED callback. </p>
<p>Any restored child fragments will be created before the base <code>Fragment.onCreate</code> method returns.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If the fragment is being re-created from a previous saved state, this is the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onCreateAnimation(int, boolean, int)"></a><a name="onCreateAnimation-int-boolean-int-"></a>
<h3 class="api-name" id="onCreateAnimation(int,boolean,int)">onCreateAnimation</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateAnimation(int,boolean,int)">onCreateAnimation</a>(transit:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;enter:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;Animation</pre>
<p>Called when a fragment loads an animation. Note that if <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)">FragmentTransaction#setCustomAnimations(int, int)</a></code> was called with Animator resources instead of Animation resources, <code>{@code nextAnim}</code> will be an animator resource.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transit</code></td>
<td width="100%">
<p>The value set in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setTransition(int)">FragmentTransaction#setTransition(int)</a></code> or 0 if not set.</p>
</td>
</tr>
<tr>
<td><code>enter</code></td>
<td width="100%">
<p><code>{@code true}</code> when the fragment is added/attached/shown or <code>{@code false}</code> when the fragment is removed/detached/hidden.</p>
</td>
</tr>
<tr>
<td><code>nextAnim</code></td>
<td width="100%">
<p>The resource set in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)">FragmentTransaction#setCustomAnimations(int, int)</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int,int,int)">FragmentTransaction#setCustomAnimations(int, int, int, int)</a></code>, or 0 if neither was called. The value will depend on the current operation.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onCreateAnimator(int, boolean, int)"></a><a name="onCreateAnimator-int-boolean-int-"></a>
<h3 class="api-name" id="onCreateAnimator(int,boolean,int)">onCreateAnimator</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateAnimator(int,boolean,int)">onCreateAnimator</a>(transit:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;enter:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;Animator</pre>
<p>Called when a fragment loads an animator. This will be called when <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateAnimation(int,boolean,int)">onCreateAnimation</a></code> returns null. Note that if <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)">FragmentTransaction#setCustomAnimations(int, int)</a></code> was called with Animation resources instead of Animator resources, <code>{@code nextAnim}</code> will be an animation resource.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transit</code></td>
<td width="100%">
<p>The value set in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setTransition(int)">FragmentTransaction#setTransition(int)</a></code> or 0 if not set.</p>
</td>
</tr>
<tr>
<td><code>enter</code></td>
<td width="100%">
<p><code>{@code true}</code> when the fragment is added/attached/shown or <code>{@code false}</code> when the fragment is removed/detached/hidden.</p>
</td>
</tr>
<tr>
<td><code>nextAnim</code></td>
<td width="100%">
<p>The resource set in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)">FragmentTransaction#setCustomAnimations(int, int)</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int,int,int)">FragmentTransaction#setCustomAnimations(int, int, int, int)</a></code>, or 0 if neither was called. The value will depend on the current operation.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)"></a><a name="onCreateContextMenu-android.view.ContextMenu-android.view.View-android.view.ContextMenu.ContextMenuInfo-"></a>
<h3 class="api-name" id="onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)">onCreateContextMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)">onCreateContextMenu</a>(menu:&nbsp;ContextMenu,&nbsp;v:&nbsp;View,&nbsp;menuInfo:&nbsp;ContextMenuInfo):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when a context menu for the <code>{@code view}</code> is about to be shown. Unlike <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code>, this will be called every time the context menu is about to be shown and should be populated for the view (or item inside the view for AdapterView subclasses, this can be found in the <code>{@code menuInfo}</code>)). </p>
<p>Use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onContextItemSelected(android.view.MenuItem)">onContextItemSelected</a></code> to know when an item has been selected. </p>
<p>The default implementation calls up to Activity#onCreateContextMenu, though you can not call this implementation if you don't want that behavior. </p>
<p>It is not safe to hold onto the context menu after this method returns. {@inheritDoc}</p>
</div>
<div><a name="onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater)"></a><a name="onCreateOptionsMenu-android.view.Menu-android.view.MenuInflater-"></a>
<h3 class="api-name" id="onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a>(menu:&nbsp;Menu,&nbsp;inflater:&nbsp;MenuInflater):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Initialize the contents of the Fragment host's standard options menu. You should place your menu items in to menu. For this method to be called, you must have first called <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a></code>. See Activity#onCreateOptionsMenu(Menu) for more information.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>menu</code></td>
<td width="100%">
<p>The options menu in which you place your items.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu)">onPrepareOptionsMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu)">onPrepareOptionsMenu</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem)">onOptionsItemSelected</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem)">onOptionsItemSelected</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)"></a><a name="onCreateView-android.view.LayoutInflater-android.view.ViewGroup-android.os.Bundle-"></a>
<h3 class="api-name" id="onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;inflater:&nbsp;LayoutInflater,<br>&nbsp;&nbsp;&nbsp;&nbsp;container:&nbsp;ViewGroup,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>):&nbsp;View</pre>
<p>Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null. This will be called between <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code>. </p>
<p>A default View can be returned by calling <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#Fragment(int)">Fragment</a></code> in your constructor. Otherwise, this method returns null. </p>
<p>It is recommended to <b>only</b> inflate the layout in this method and move logic that operates on the returned View to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code>. </p>
<p>If you return a View from here, you will later be called in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a></code> when the view is being released.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>View</code></td>
<td width="100%">
<p>Return the View for the fragment's UI, or null.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>inflater</code></td>
<td width="100%">
<p>The LayoutInflater object that can be used to inflate any views in the fragment,</p>
</td>
</tr>
<tr>
<td><code>container</code></td>
<td width="100%">
<p>If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.</p>
</td>
</tr>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If non-null, this fragment is being re-constructed from a previous saved state as given here.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onDestroy--"></a>
<h3 class="api-name" id="onDestroy()">onDestroy</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the fragment is no longer in use. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStop()">onStop</a></code> and before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDetach()">onDetach</a></code>.</p>
</div>
<div><a name="onDestroyOptionsMenu--"></a>
<h3 class="api-name" id="onDestroyOptionsMenu()">onDestroyOptionsMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyOptionsMenu()">onDestroyOptionsMenu</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when this fragment's option menu items are no longer being included in the overall options menu. Receiving this call means that the menu needed to be rebuilt, but this fragment's items were not included in the newly built menu (its <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code> was not called).</p>
</div>
<div><a name="onDestroyView--"></a>
<h3 class="api-name" id="onDestroyView()">onDestroyView</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroyView()">onDestroyView</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the view previously created by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> has been detached from the fragment. The next time the fragment needs to be displayed, a new view will be created. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStop()">onStop</a></code> and before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a></code>. It is called <em>regardless</em> of whether <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> returned a non-null view. Internally it is called after the view's state has been saved but before it has been removed from its parent.</p>
</div>
<div><a name="onDetach--"></a>
<h3 class="api-name" id="onDetach()">onDetach</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDetach()">onDetach</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the fragment is no longer attached to its activity. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a></code>.</p>
</div>
<div><a name="onGetLayoutInflater-android.os.Bundle-"></a>
<h3 class="api-name" id="onGetLayoutInflater(android.os.Bundle)">onGetLayoutInflater</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onGetLayoutInflater(android.os.Bundle)">onGetLayoutInflater</a>(savedInstanceState:&nbsp;Bundle):&nbsp;LayoutInflater</pre>
<p>Returns the LayoutInflater used to inflate Views of this Fragment. The default implementation will throw an exception if the Fragment is not attached.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>LayoutInflater</code></td>
<td width="100%">
<p>The LayoutInflater used to inflate Views of this Fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If the fragment is being re-created from a previous saved state, this is the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onHiddenChanged-boolean-"></a>
<h3 class="api-name" id="onHiddenChanged(boolean)">onHiddenChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onHiddenChanged(boolean)">onHiddenChanged</a>(hidden:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the hidden state (as returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isHidden()">isHidden</a></code> of the fragment has changed. Fragments start out not hidden; this will be called whenever the fragment changes state from that.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hidden</code></td>
<td width="100%">
<p>True if the fragment is now hidden, false otherwise.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle)"></a><a name="onInflate-android.content.Context-android.util.AttributeSet-android.os.Bundle-"></a>
<h3 class="api-name" id="onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)">onInflate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)">onInflate</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;context:&nbsp;Context,<br>&nbsp;&nbsp;&nbsp;&nbsp;attrs:&nbsp;AttributeSet,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity. This may be called immediately after the fragment is created from a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentContainerView.html">FragmentContainerView</a></code> in a layout file. Note this is <em>before</em>the fragment's <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code> has been called; all you should do here is parse the attributes and save them away. </p>
<p>This is called <em>the first time</em> the fragment is inflated. If it is being inflated into a new instance with saved state, this method will not be called a second time for the restored state fragment.</p>
<p>Here is a typical implementation of a fragment that can take parameters both through attributes supplied here as well from <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a></code>:</p>
{@sample frameworks/support/samples/Support4Demos/src/main/java/com/example/android/supportv4/app/FragmentArgumentsSupport.java * fragment}
<p>Note that parsing the XML attributes uses a &quot;styleable&quot; resource. The declaration for the styleable used here is:</p>
{@sample frameworks/support/samples/Support4Demos/src/main/res/values/attrs.xml fragment_arguments}
<p>The fragment can then be declared within its activity's content layout through a tag like this:</p>
{@sample frameworks/support/samples/Support4Demos/src/main/res/layout/fragment_arguments_support.xml from_attributes}
<p>This fragment can also be created dynamically from arguments given at runtime in the arguments Bundle; here is an example of doing so at creation of the containing activity:</p>
{@sample frameworks/support/samples/Support4Demos/src/main/java/com/example/android/supportv4/app/FragmentArgumentsSupport.java * create}
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>context</code></td>
<td width="100%">
<p>The Activity that is inflating this fragment.</p>
</td>
</tr>
<tr>
<td><code>attrs</code></td>
<td width="100%">
<p>The attributes at the tag where the fragment is being created.</p>
</td>
</tr>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If the fragment is being re-created from a previous saved state, this is the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle)"></a><a name="onInflate-android.app.Activity-android.util.AttributeSet-android.os.Bundle-"></a>
<h3 class="api-name" id="onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle)">onInflate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle)">onInflate</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;activity:&nbsp;Activity,<br>&nbsp;&nbsp;&nbsp;&nbsp;attrs:&nbsp;AttributeSet,<br>&nbsp;&nbsp;&nbsp;&nbsp;savedInstanceState:&nbsp;Bundle<br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>See <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)">onInflate</a></code>.</p>
</aside>
<p>Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity.</p>
</div>
<div><a name="onLowMemory--"></a>
<h3 class="api-name" id="onLowMemory()">onLowMemory</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onLowMemory()">onLowMemory</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
</div>
<div><a name="onMultiWindowModeChanged-boolean-"></a>
<h3 class="api-name" id="onMultiWindowModeChanged(boolean)">onMultiWindowModeChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onMultiWindowModeChanged(boolean)">onMultiWindowModeChanged</a>(isInMultiWindowMode:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the Fragment's activity changes from fullscreen mode to multi-window mode and visa-versa. This is generally tied to Activity#onMultiWindowModeChanged of the containing Activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>isInMultiWindowMode</code></td>
<td width="100%">
<p>True if the activity is in multi-window mode.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onOptionsItemSelected-android.view.MenuItem-"></a>
<h3 class="api-name" id="onOptionsItemSelected(android.view.MenuItem)">onOptionsItemSelected</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem)">onOptionsItemSelected</a>(item:&nbsp;MenuItem):&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>This hook is called whenever an item in your options menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities. </p>
<p>Derived classes should call through to the base class for it to perform the default menu handling.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>boolean Return false to allow normal menu processing to proceed, true to consume it here.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>item</code></td>
<td width="100%">
<p>The menu item that was selected.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onOptionsMenuClosed-android.view.Menu-"></a>
<h3 class="api-name" id="onOptionsMenuClosed(android.view.Menu)">onOptionsMenuClosed</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onOptionsMenuClosed(android.view.Menu)">onOptionsMenuClosed</a>(menu:&nbsp;Menu):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>menu</code></td>
<td width="100%">
<p>The options menu as last shown or first initialized by onCreateOptionsMenu().</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onPause--"></a>
<h3 class="api-name" id="onPause()">onPause</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPause()">onPause</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the Fragment is no longer resumed. This is generally tied to Activity#onPause() of the containing Activity's lifecycle.</p>
</div>
<div><a name="onPictureInPictureModeChanged-boolean-"></a>
<h3 class="api-name" id="onPictureInPictureModeChanged(boolean)">onPictureInPictureModeChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPictureInPictureModeChanged(boolean)">onPictureInPictureModeChanged</a>(isInPictureInPictureMode:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called by the system when the activity changes to and from picture-in-picture mode. This is generally tied to Activity#onPictureInPictureModeChanged of the containing Activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>isInPictureInPictureMode</code></td>
<td width="100%">
<p>True if the activity is in picture-in-picture mode.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onPrepareOptionsMenu-android.view.Menu-"></a>
<h3 class="api-name" id="onPrepareOptionsMenu(android.view.Menu)">onPrepareOptionsMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu)">onPrepareOptionsMenu</a>(menu:&nbsp;Menu):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Prepare the Fragment host's standard options menu to be displayed. This is called right before the menu is shown, every time it is shown. You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents. See Activity#onPrepareOptionsMenu(Menu) for more information.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>menu</code></td>
<td width="100%">
<p>The options menu as last shown or first initialized by onCreateOptionsMenu().</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onPrimaryNavigationFragmentChanged-boolean-"></a>
<h3 class="api-name" id="onPrimaryNavigationFragmentChanged(boolean)">onPrimaryNavigationFragmentChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPrimaryNavigationFragmentChanged(boolean)">onPrimaryNavigationFragmentChanged</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;isPrimaryNavigationFragment:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a><br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Callback for when the primary navigation state of this Fragment has changed. This can be the result of the <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a></code> containing FragmentManager} having its primary navigation fragment changed via <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setPrimaryNavigationFragment(androidx.fragment.app.Fragment)">setPrimaryNavigationFragment</a></code> or due to the primary navigation fragment changing in a parent FragmentManager.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>isPrimaryNavigationFragment</code></td>
<td width="100%">
<p>True if and only if this Fragment and any <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragment()">parent fragment</a></code> is set as the primary navigation fragment via <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setPrimaryNavigationFragment(androidx.fragment.app.Fragment)">setPrimaryNavigationFragment</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onRequestPermissionsResult(int, java.lang.String[], int[])"></a><a name="onRequestPermissionsResult-int-java.lang.String[]-int[]-"></a>
<h3 class="api-name" id="onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;permissions:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;grantResults:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/kotlin/Int.html">Int</a>&gt;<br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</aside>
<p>Callback for the result from requesting permissions. This method is invoked for every call on <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code>. </p>
<p><b>Note:</b> It is possible that the permissions request interaction with the user is interrupted. In this case you will receive empty permissions and results arrays which should be treated as a cancellation. </p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>The request code passed in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code>.</p>
</td>
</tr>
<tr>
<td><code>permissions</code></td>
<td width="100%">
<p>The requested permissions. Never null.</p>
</td>
</tr>
<tr>
<td><code>grantResults</code></td>
<td width="100%">
<p>The grant results for the corresponding permissions which is either PERMISSION_GRANTED or PERMISSION_DENIED. Never null.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onResume--"></a>
<h3 class="api-name" id="onResume()">onResume</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onResume()">onResume</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the fragment is visible to the user and actively running. This is generally tied to Activity#onResume() of the containing Activity's lifecycle.</p>
</div>
<div><a name="onSaveInstanceState-android.os.Bundle-"></a>
<h3 class="api-name" id="onSaveInstanceState(android.os.Bundle)">onSaveInstanceState</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onSaveInstanceState(android.os.Bundle)">onSaveInstanceState</a>(outState:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance if its process is restarted. If a new instance of the fragment later needs to be created, the data you place in the Bundle here will be available in the Bundle given to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>, and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code>. </p>
<p>This corresponds to Activity#onSaveInstanceState(Bundle) and most of the discussion there applies here as well. Note however: <em>this method may be called at any time before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a></code></em>. There are many situations where a fragment may be mostly torn down (such as when placed on the back stack with no UI showing), but its state will not be saved until its owning activity actually needs to save its state.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>outState</code></td>
<td width="100%">
<p>Bundle in which to place your saved state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onStart--"></a>
<h3 class="api-name" id="onStart()">onStart</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStart()">onStart</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the Fragment is visible to the user. This is generally tied to Activity#onStart() of the containing Activity's lifecycle.</p>
</div>
<div><a name="onStop--"></a>
<h3 class="api-name" id="onStop()">onStop</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStop()">onStop</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when the Fragment is no longer started. This is generally tied to Activity#onStop() of the containing Activity's lifecycle.</p>
</div>
<div><a name="onViewCreated(android.view.View, android.os.Bundle)"></a><a name="onViewCreated-android.view.View-android.os.Bundle-"></a>
<h3 class="api-name" id="onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a>(view:&nbsp;View,&nbsp;savedInstanceState:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called immediately after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> has returned, but before any saved state has been restored in to the view. This gives subclasses a chance to initialize themselves once they know their view hierarchy has been completely created. The fragment's view hierarchy is not however attached to its parent at this point.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>view</code></td>
<td width="100%">
<p>The View returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>.</p>
</td>
</tr>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If non-null, this fragment is being re-constructed from a previous saved state as given here.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onViewStateRestored-android.os.Bundle-"></a>
<h3 class="api-name" id="onViewStateRestored(android.os.Bundle)">onViewStateRestored</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewStateRestored(android.os.Bundle)">onViewStateRestored</a>(savedInstanceState:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Called when all saved state has been restored into the view hierarchy of the fragment. This can be used to do initialization based on saved state that you are letting the view hierarchy track itself, such as whether check box widgets are currently checked. This is called after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onViewCreated(android.view.View,android.os.Bundle)">onViewCreated</a></code> and before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onStart()">onStart</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>savedInstanceState</code></td>
<td width="100%">
<p>If the fragment is being re-created from a previous saved state, this is the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="postponeEnterTransition--"></a>
<h3 class="api-name" id="postponeEnterTransition()">postponeEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition()">postponeEnterTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Postpone the entering Fragment transition until <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code> or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">FragmentManager#executePendingTransactions()</a></code> has been called. </p>
<p>This method gives the Fragment the ability to delay Fragment animations until all data is loaded. Until then, the added, shown, and attached Fragments will be INVISIBLE and removed, hidden, and detached Fragments won't be have their Views removed. The transaction runs when all postponed added Fragments in the transaction have called <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code>. </p>
<p>This method should be called before being added to the FragmentTransaction or in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>}. <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code> must be called to allow the Fragment to start the transitions. </p>
<p>When a FragmentTransaction is started that may affect a postponed FragmentTransaction, based on which containers are in their operations, the postponed FragmentTransaction will have its start triggered. The early triggering may result in faulty or nonexistent animations in the postponed transaction. FragmentTransactions that operate only on independent containers will not interfere with each other's postponement. </p>
<p>Calling postponeEnterTransition on Fragments with a null View will not postpone the transition. Likewise, postponement only works if <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">FragmentTransaction#setReorderingAllowed(boolean)</a></code> is enabled.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/android/app/Activity.html#postponeEnterTransition()">Activity</a></code></td>
<td width="100%"></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">setReorderingAllowed</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">setReorderingAllowed</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="postponeEnterTransition(long, java.util.concurrent.TimeUnit)"></a><a name="postponeEnterTransition-long-java.util.concurrent.TimeUnit-"></a>
<h3 class="api-name" id="postponeEnterTransition(long,java.util.concurrent.TimeUnit)">postponeEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition(long,java.util.concurrent.TimeUnit)">postponeEnterTransition</a>(duration:&nbsp;<a href="/reference/kotlin/kotlin/Long.html">Long</a>,&nbsp;timeUnit:&nbsp;<a href="/reference/kotlin/java/util/concurrent/TimeUnit.html">TimeUnit</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Postpone the entering Fragment transition for a given amount of time and then call <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code>. </p>
<p>This method gives the Fragment the ability to delay Fragment animations for a given amount of time. Until then, the added, shown, and attached Fragments will be INVISIBLE and removed, hidden, and detached Fragments won't be have their Views removed. The transaction runs when all postponed added Fragments in the transaction have called <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a></code>. </p>
<p>This method should be called before being added to the FragmentTransaction or in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.content.Context)">onAttach</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>}. </p>
<p>When a FragmentTransaction is started that may affect a postponed FragmentTransaction, based on which containers are in their operations, the postponed FragmentTransaction will have its start triggered. The early triggering may result in faulty or nonexistent animations in the postponed transaction. FragmentTransactions that operate only on independent containers will not interfere with each other's postponement. </p>
<p>Calling postponeEnterTransition on Fragments with a null View will not postpone the transition. Likewise, postponement only works if <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">FragmentTransaction#setReorderingAllowed(boolean)</a></code> is enabled.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>duration</code></td>
<td width="100%">
<p>The length of the delay in <code>{@code timeUnit}</code> units</p>
</td>
</tr>
<tr>
<td><code>timeUnit</code></td>
<td width="100%">
<p>The units of time for <code>{@code duration}</code></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/android/app/Activity.html#postponeEnterTransition()">Activity</a></code></td>
<td width="100%"></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">setReorderingAllowed</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setReorderingAllowed(boolean)">setReorderingAllowed</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;, androidx.activity.result.ActivityResultCallback&lt;O&gt;)"></a><a name="registerForActivityResult-androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;-androidx.activity.result.ActivityResultCallback&lt;O&gt;-"></a>
<h3 class="api-name" id="registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;contract:&nbsp;ActivityResultContract&lt;I, O&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;callback:&nbsp;ActivityResultCallback&lt;O&gt;<br>):&nbsp;ActivityResultLauncher&lt;I&gt;</pre>
<p>{@inheritDoc} </p>
<p>If the host of this fragment is an ActivityResultRegistryOwner the ActivityResultRegistry of the host will be used. Otherwise, this will use the registry of the Fragment's Activity.</p>
</div>
<div><a name="registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;, androidx.activity.result.ActivityResultRegistry, androidx.activity.result.ActivityResultCallback&lt;O&gt;)"></a><a name="registerForActivityResult-androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;-androidx.activity.result.ActivityResultRegistry-androidx.activity.result.ActivityResultCallback&lt;O&gt;-"></a>
<h3 class="api-name" id="registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;contract:&nbsp;ActivityResultContract&lt;I, O&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;registry:&nbsp;ActivityResultRegistry,<br>&nbsp;&nbsp;&nbsp;&nbsp;callback:&nbsp;ActivityResultCallback&lt;O&gt;<br>):&nbsp;ActivityResultLauncher&lt;I&gt;</pre>
</div>
<div><a name="registerForContextMenu-android.view.View-"></a>
<h3 class="api-name" id="registerForContextMenu(android.view.View)">registerForContextMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForContextMenu(android.view.View)">registerForContextMenu</a>(view:&nbsp;View):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Registers a context menu to be shown for the given view (multiple views can show the context menu). This method will set the OnCreateContextMenuListener on the view to this fragment, so <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)">onCreateContextMenu</a></code> will be called when it is time to show the context menu.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>view</code></td>
<td width="100%">
<p>The view that should show a context menu.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#unregisterForContextMenu(android.view.View)">unregisterForContextMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#unregisterForContextMenu(android.view.View)">unregisterForContextMenu</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requestPermissions(java.lang.String[], int)"></a><a name="requestPermissions-java.lang.String[]-int-"></a>
<h3 class="api-name" id="requestPermissions(java.lang.String[],int)">requestPermissions</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></del></span>(permissions:&nbsp;<a href="/reference/kotlin/kotlin/Array.html">Array</a>&lt;<a href="/reference/kotlin/java/lang/String.html">String</a>&gt;,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the ActivityResultCallback#onActivityResult(Object).</p>
</aside>
<p>Requests permissions to be granted to this application. These permissions must be requested in your manifest, they should not be granted to your app, and they should have protection level #PROTECTION_DANGEROUS dangerous, regardless whether they are declared by the platform or a third-party app. </p>
<p>Normal permissions PROTECTION_NORMAL are granted at install time if requested in the manifest. Signature permissions PROTECTION_SIGNATURE are granted at install time if requested in the manifest and the signature of your app matches the signature of the app declaring the permissions. </p>
<p>Call <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String)">shouldShowRequestPermissionRationale</a></code> before calling this API to check if the system recommends to show a rationale dialog before asking for a permission. </p>
<p>If your app does not have the requested permissions the user will be presented with UI for accepting them. After the user has accepted or rejected the requested permissions you will receive a callback on <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])"></a></code> reporting whether the permissions were granted or not. </p>
<p>Note that requesting a permission does not guarantee it will be granted and your app should be able to run without having this permission. </p>
<p>This method may start an activity allowing the user to choose which permissions to grant and which to reject. Hence, you should be prepared that your activity may be paused and resumed. Further, granting some permissions may require a restart of you application. In such a case, the system will recreate the activity stack before delivering the result to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])"></a></code>. </p>
<p>When checking whether you have a permission you should use . </p>
<p>Calling this API for permissions already granted to your app would show UI to the user to decided whether the app can still hold these permissions. This can be useful if the way your app uses the data guarded by the permissions changes significantly. </p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>permissions</code></td>
<td width="100%">
<p>The requested permissions.</p>
</td>
</tr>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>Application specific request code to match with a result reported to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></code>. Must be between 0 and 65535 to be considered valid. If given requestCode is greater than 65535, an IllegalArgumentException would be thrown.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/android/content/Context.html#checkSelfPermission(String)">Context</a></code></td>
<td width="100%"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireActivity--"></a>
<h3 class="api-name" id="requireActivity()">requireActivity</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireActivity()">requireActivity</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></pre>
<p>Return the <code><a href="/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code> this fragment is currently associated with.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if not currently associated with an activity or if associated only with a context.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireArguments--"></a>
<h3 class="api-name" id="requireArguments()">requireArguments</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireArguments()">requireArguments</a>():&nbsp;Bundle</pre>
<p>Return the arguments supplied when the fragment was instantiated.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if no arguments were supplied to the Fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getArguments()">getArguments</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireContext--"></a>
<h3 class="api-name" id="requireContext()">requireContext</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireContext()">requireContext</a>():&nbsp;Context</pre>
<p>Return the Context this fragment is currently associated with.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if not currently associated with a context.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getContext()">getContext</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getContext()">getContext</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireFragmentManager--"></a>
<h3 class="api-name" id="requireFragmentManager()">requireFragmentManager</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireFragmentManager()">requireFragmentManager</a></del></span>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>This has been renamed to <code>getParentFragmentManager()</code> to make it clear that you are accessing the FragmentManager that contains this Fragment and not the FragmentManager associated with child Fragments.</p>
</aside>
<p>Return the FragmentManager for interacting with fragments associated with this fragment's activity. Note that this will available slightly before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getActivity()">getActivity</a></code>, during the time from when the fragment is placed in a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code> until it is committed and attached to its activity. </p>
<p>If this Fragment is a child of another Fragment, the FragmentManager returned here will be the parent's <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getChildFragmentManager()">getChildFragmentManager</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if not associated with a transaction or host.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">getParentFragmentManager</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireHost--"></a>
<h3 class="api-name" id="requireHost()">requireHost</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireHost()">requireHost</a>():&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a></pre>
<p>Return the host object of this fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if not currently associated with a host.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getHost()">getHost</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getHost()">getHost</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireParentFragment--"></a>
<h3 class="api-name" id="requireParentFragment()">requireParentFragment</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireParentFragment()">requireParentFragment</a>():&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<p>Returns the parent Fragment containing this Fragment.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if this Fragment is attached directly to an Activity or other Fragment host.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragment()">getParentFragment</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragment()">getParentFragment</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="requireView--"></a>
<h3 class="api-name" id="requireView()">requireView</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requireView()">requireView</a>():&nbsp;View</pre>
<p>Get the root view for the fragment's layout (the one returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>).</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Throws</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>java.lang.IllegalStateException</code></td>
<td width="100%">
<p>if no view was returned by <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">getView</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getView()">getView</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setAllowEnterTransitionOverlap-boolean-"></a>
<h3 class="api-name" id="setAllowEnterTransitionOverlap(boolean)">setAllowEnterTransitionOverlap</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setAllowEnterTransitionOverlap(boolean)">setAllowEnterTransitionOverlap</a>(allow:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets whether the the exit transition and enter transition overlap or not. When true, the enter transition will start as soon as possible. When false, the enter transition will wait until the exit transition completes before starting.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>allow</code></td>
<td width="100%">
<p>true to start the enter transition when possible or false to wait until the exiting transition completes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setAllowReturnTransitionOverlap-boolean-"></a>
<h3 class="api-name" id="setAllowReturnTransitionOverlap(boolean)">setAllowReturnTransitionOverlap</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setAllowReturnTransitionOverlap(boolean)">setAllowReturnTransitionOverlap</a>(allow:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets whether the the return transition and reenter transition overlap or not. When true, the reenter transition will start as soon as possible. When false, the reenter transition will wait until the return transition completes before starting.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>allow</code></td>
<td width="100%">
<p>true to start the reenter transition when possible or false to wait until the return transition completes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setArguments-android.os.Bundle-"></a>
<h3 class="api-name" id="setArguments(android.os.Bundle)">setArguments</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a>(args:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Supply the construction arguments for this fragment. The arguments supplied here will be retained across fragment destroy and creation. </p>
<p>This method cannot be called if the fragment is added to a FragmentManager and if <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#isStateSaved()">isStateSaved</a></code> would return true.</p>
</div>
<div><a name="setEnterSharedElementCallback-androidx.core.app.SharedElementCallback-"></a>
<h3 class="api-name" id="setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)">setEnterSharedElementCallback</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)">setEnterSharedElementCallback</a>(callback:&nbsp;SharedElementCallback):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>When custom transitions are used with Fragments, the enter transition callback is called when this Fragment is attached or detached when not popping the back stack.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>callback</code></td>
<td width="100%">
<p>Used to manipulate the shared element transitions on this Fragment when added not as a pop from the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setEnterTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setEnterTransition(java.lang.Object)">setEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setEnterTransition(java.lang.Object)">setEnterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used to move Views into the initial scene. The entering Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as entering is governed by changing visibility from View#INVISIBLE to View#VISIBLE. If <code>transition</code> is null, entering Views will remain unaffected.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use to move Views into the initial Scene. <code>transition</code> must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setExitSharedElementCallback-androidx.core.app.SharedElementCallback-"></a>
<h3 class="api-name" id="setExitSharedElementCallback(androidx.core.app.SharedElementCallback)">setExitSharedElementCallback</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setExitSharedElementCallback(androidx.core.app.SharedElementCallback)">setExitSharedElementCallback</a>(callback:&nbsp;SharedElementCallback):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>When custom transitions are used with Fragments, the exit transition callback is called when this Fragment is attached or detached when popping the back stack.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>callback</code></td>
<td width="100%">
<p>Used to manipulate the shared element transitions on this Fragment when added as a pop from the back stack.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setExitTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setExitTransition(java.lang.Object)">setExitTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setExitTransition(java.lang.Object)">setExitTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack. The exiting Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as exiting is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If transition is null, the views will remain unaffected.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use to move Views out of the Scene when the Fragment is being closed not due to popping the back stack. <code>transition</code>must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setHasOptionsMenu-boolean-"></a>
<h3 class="api-name" id="setHasOptionsMenu(boolean)">setHasOptionsMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setHasOptionsMenu(boolean)">setHasOptionsMenu</a>(hasMenu:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Report that this fragment would like to participate in populating the options menu by receiving a call to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)">onCreateOptionsMenu</a></code> and related methods.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hasMenu</code></td>
<td width="100%">
<p>If true, the fragment has menu items to contribute.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setInitialSavedState-androidx.fragment.app.Fragment.SavedState-"></a>
<h3 class="api-name" id="setInitialSavedState(androidx.fragment.app.Fragment.SavedState)">setInitialSavedState</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setInitialSavedState(androidx.fragment.app.Fragment.SavedState)">setInitialSavedState</a>(state:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.SavedState.html">Fragment.SavedState</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#saveFragmentInstanceState(androidx.fragment.app.Fragment)">FragmentManager#saveFragmentInstanceState(Fragment)</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>state</code></td>
<td width="100%">
<p>The state the fragment should be restored from.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setMenuVisibility-boolean-"></a>
<h3 class="api-name" id="setMenuVisibility(boolean)">setMenuVisibility</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setMenuVisibility(boolean)">setMenuVisibility</a>(menuVisible:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Set a hint for whether this fragment's menu should be visible. This is useful if you know that a fragment has been placed in your view hierarchy so that the user can not currently seen it, so any menu items it has should also not be shown.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>menuVisible</code></td>
<td width="100%">
<p>The default is true, meaning the fragment's menu will be shown as usual. If false, the user will not see the menu.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setReenterTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setReenterTransition(java.lang.Object)">setReenterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setReenterTransition(java.lang.Object)">setReenterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used to move Views in to the scene when returning due to popping a back stack. The entering Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as exiting is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If transition is null, the views will remain unaffected. If nothing is set, the default will be to use the same transition as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getExitTransition()">getExitTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use to move Views into the scene when reentering from a previously-started Activity due to popping the back stack. <code>transition</code>must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setRetainInstance-boolean-"></a>
<h3 class="api-name" id="setRetainInstance(boolean)">setRetainInstance</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setRetainInstance(boolean)">setRetainInstance</a></del></span>(retain:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment. The ViewModel's constructor and its onCleared() callback provide the signal for initial creation and final destruction of the retained state.</p>
</aside>
<p>Control whether a fragment instance is retained across Activity re-creation (such as from a configuration change). If set, the fragment lifecycle will be slightly different when an activity is recreated: </p>
<ul>
<li><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDestroy()">onDestroy</a></code> will not be called (but <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onDetach()">onDetach</a></code> still will be, because the fragment is being detached from its current activity). </li>
<li><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreate(android.os.Bundle)">onCreate</a></code> will not be called since the fragment is not being re-created. </li>
<li><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onAttach(android.app.Activity)">onAttach</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityCreated(android.os.Bundle)">onActivityCreated</a></code><b>will</b>still be called. </li>
</ul>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>retain</code></td>
<td width="100%">
<p><code>true</code> to retain this fragment instance across configuration changes, <code>false</code> otherwise.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getRetainInstance()">getRetainInstance</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getRetainInstance()">getRetainInstance</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setReturnTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setReturnTransition(java.lang.Object)">setReturnTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setReturnTransition(java.lang.Object)">setReturnTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack. The exiting Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as entering is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If <code>transition</code> is null, entering Views will remain unaffected. If nothing is set, the default will be to use the same value as set in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setEnterTransition(java.lang.Object)">setEnterTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use to move Views out of the Scene when the Fragment is preparing to close due to popping the back stack. <code>transition</code> must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setSharedElementEnterTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setSharedElementEnterTransition(java.lang.Object)">setSharedElementEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementEnterTransition(java.lang.Object)">setSharedElementEnterTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used for shared elements transferred into the content Scene. Typical Transitions will affect size and location, such as android.transition.ChangeBounds. A null value will cause transferred shared elements to blink to the final position.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use for shared elements transferred into the content Scene. <code>transition</code> must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setSharedElementReturnTransition-java.lang.Object-"></a>
<h3 class="api-name" id="setSharedElementReturnTransition(java.lang.Object)">setSharedElementReturnTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementReturnTransition(java.lang.Object)">setSharedElementReturnTransition</a>(transition:&nbsp;<a href="/reference/kotlin/kotlin/Any.html">Any</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Sets the Transition that will be used for shared elements transferred back during a pop of the back stack. This Transition acts in the leaving Fragment. Typical Transitions will affect size and location, such as android.transition.ChangeBounds. A null value will cause transferred shared elements to blink to the final position. If no value is set, the default will be to use the same value as <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setSharedElementEnterTransition(java.lang.Object)">setSharedElementEnterTransition</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>transition</code></td>
<td width="100%">
<p>The Transition to use for shared elements transferred out of the content Scene. <code>transition</code> must be an android.transition.Transition or androidx.transition.Transition.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setTargetFragment(androidx.fragment.app.Fragment, int)"></a><a name="setTargetFragment-androidx.fragment.app.Fragment-int-"></a>
<h3 class="api-name" id="setTargetFragment(androidx.fragment.app.Fragment,int)">setTargetFragment</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setTargetFragment(androidx.fragment.app.Fragment,int)">setTargetFragment</a></del></span>(fragment:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Instead of using a target fragment to pass results, the fragment requesting a result should use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code> to register a <code><a href="/reference/kotlin/androidx/fragment/app/FragmentResultListener.html">FragmentResultListener</a></code> with a <code>{@code * requestKey}</code> using its <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#getParentFragmentManager()">parent fragment manager</a></code>. The fragment delivering a result should then call <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code> using the same <code>{@code requestKey}</code>. Consider using <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setArguments(android.os.Bundle)">setArguments</a></code> to pass the <code>{@code requestKey}</code> if you need to support dynamic request keys.</p>
</aside>
<p>Optional target for this fragment. This may be used, for example, if this fragment is being started by another, and when done wants to give a result back to the first. The target set here is retained across instances via <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#putFragment(android.os.Bundle,java.lang.String,androidx.fragment.app.Fragment)">FragmentManager#putFragment</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>fragment</code></td>
<td width="100%">
<p>The fragment that is the target of this one.</p>
</td>
</tr>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>Optional request code, for convenience if you are going to call back with <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">onActivityResult</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setUserVisibleHint-boolean-"></a>
<h3 class="api-name" id="setUserVisibleHint(boolean)">setUserVisibleHint</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">setUserVisibleHint</a></del></span>(isVisibleToUser:&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>If you are manually calling this method, use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)">FragmentTransaction#setMaxLifecycle(Fragment, Lifecycle.State)</a></code> instead. If overriding this method, behavior implemented when passing in <code>true</code> should be moved to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onResume()">Fragment#onResume()</a></code>, and behavior implemented when passing in <code>false</code> should be moved to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onPause()">Fragment#onPause()</a></code>.</p>
</aside>
<p>Set a hint to the system about whether this fragment's UI is currently visible to the user. This hint defaults to true and is persistent across fragment instance state save and restore. </p>
<p>An app may set this to false to indicate that the fragment's UI is scrolled out of visibility or is otherwise not directly visible to the user. This may be used by the system to prioritize operations such as fragment lifecycle updates or loader ordering behavior.</p>
<p><b>Note:</b> This method may be called outside of the fragment lifecycle. and thus has no ordering guarantees with regard to fragment lifecycle method calls.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>isVisibleToUser</code></td>
<td width="100%">
<p>true if this fragment's UI is currently visible to the user (default), false if it is not.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="shouldShowRequestPermissionRationale-java.lang.String-"></a>
<h3 class="api-name" id="shouldShowRequestPermissionRationale(java.lang.String)">shouldShowRequestPermissionRationale</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String)">shouldShowRequestPermissionRationale</a>(permission:&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a>):&nbsp;<a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></pre>
<p>Gets whether you should show UI with rationale before requesting a permission.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/kotlin/Boolean.html">Boolean</a></code></td>
<td width="100%">
<p>Whether you should show permission rationale UI.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>permission</code></td>
<td width="100%">
<p>A permission your app wants to request.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/android/content/Context.html#checkSelfPermission(String)">Context</a></code></td>
<td width="100%"></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#requestPermissions(java.lang.String[],int)">requestPermissions</a></code></td>
</tr>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onRequestPermissionsResult(int,java.lang.String[],int[])">onRequestPermissionsResult</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="startActivity-android.content.Intent-"></a>
<h3 class="api-name" id="startActivity(android.content.Intent)">startActivity</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivity(android.content.Intent)">startActivity</a>(intent:&nbsp;Intent):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Call Activity#startActivity(Intent) from the fragment's containing Activity.</p>
</div>
<div><a name="startActivity(android.content.Intent, android.os.Bundle)"></a><a name="startActivity-android.content.Intent-android.os.Bundle-"></a>
<h3 class="api-name" id="startActivity(android.content.Intent,android.os.Bundle)">startActivity</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivity(android.content.Intent,android.os.Bundle)">startActivity</a>(intent:&nbsp;Intent,&nbsp;options:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Call Activity#startActivity(Intent, Bundle) from the fragment's containing Activity.</p>
</div>
<div><a name="startActivityForResult(android.content.Intent, int)"></a><a name="startActivityForResult-android.content.Intent-int-"></a>
<h3 class="api-name" id="startActivityForResult(android.content.Intent,int)">startActivityForResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivityForResult(android.content.Intent,int)">startActivityForResult</a></del></span>(intent:&nbsp;Intent,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartActivityForResult object for the ActivityResultContract.</p>
</aside>
<p>Call Activity#startActivityForResult(Intent, int) from the fragment's containing Activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>intent</code></td>
<td width="100%">
<p>The intent to start.</p>
</td>
</tr>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>The request code to be returned in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">Fragment#onActivityResult(int, int, Intent)</a></code> when the activity exits. Must be between 0 and 65535 to be considered valid. If given requestCode is greater than 65535, an IllegalArgumentException would be thrown.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="startActivityForResult(android.content.Intent, int, android.os.Bundle)"></a><a name="startActivityForResult-android.content.Intent-int-android.os.Bundle-"></a>
<h3 class="api-name" id="startActivityForResult(android.content.Intent,int,android.os.Bundle)">startActivityForResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startActivityForResult(android.content.Intent,int,android.os.Bundle)">startActivityForResult</a></del></span>(intent:&nbsp;Intent,&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,&nbsp;options:&nbsp;Bundle):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartActivityForResult object for the ActivityResultContract.</p>
</aside>
<p>Call Activity#startActivityForResult(Intent, int, Bundle) from the fragment's containing Activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>intent</code></td>
<td width="100%">
<p>The intent to start.</p>
</td>
</tr>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>The request code to be returned in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">Fragment#onActivityResult(int, int, Intent)</a></code> when the activity exits. Must be between 0 and 65535 to be considered valid. If given requestCode is greater than 65535, an IllegalArgumentException would be thrown.</p>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td width="100%">
<p>Additional options for how the Activity should be started. See Context#startActivity(Intent, Bundle) for more details. This value may be null.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)"></a><a name="startIntentSenderForResult-android.content.IntentSender-int-android.content.Intent-int-int-int-android.os.Bundle-"></a>
<h3 class="api-name" id="startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">startIntentSenderForResult</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">startIntentSenderForResult</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;intent:&nbsp;IntentSender,<br>&nbsp;&nbsp;&nbsp;&nbsp;requestCode:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fillInIntent:&nbsp;Intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsMask:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsValues:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;extraFlags:&nbsp;<a href="/reference/kotlin/kotlin/Int.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;options:&nbsp;Bundle<br>):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">registerForActivityResult</a></code> passing in a StartIntentSenderForResult object for the ActivityResultContract.</p>
</aside>
<p>Call Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int, Bundle) from the fragment's containing Activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>intent</code></td>
<td width="100%">
<p>The IntentSender to launch.</p>
</td>
</tr>
<tr>
<td><code>requestCode</code></td>
<td width="100%">
<p>The request code to be returned in <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onActivityResult(int,int,android.content.Intent)">Fragment#onActivityResult(int, int, Intent)</a></code> when the activity exits. Must be between 0 and 65535 to be considered valid. If given requestCode is greater than 65535, an IllegalArgumentException would be thrown.</p>
</td>
</tr>
<tr>
<td><code>fillInIntent</code></td>
<td width="100%">
<p>If non-null, this will be provided as the intent parameter to IntentSender#sendIntent(Context, int, Intent, IntentSender.OnFinished, Handler). This value may be null.</p>
</td>
</tr>
<tr>
<td><code>flagsMask</code></td>
<td width="100%">
<p>Intent flags in the original IntentSender that you would like to change.</p>
</td>
</tr>
<tr>
<td><code>flagsValues</code></td>
<td width="100%">
<p>Desired values for any bits set in <code>flagsMask</code>.</p>
</td>
</tr>
<tr>
<td><code>extraFlags</code></td>
<td width="100%">
<p>Always set to 0.</p>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td width="100%">
<p>Additional options for how the Activity should be started. See Context#startActivity(Intent, Bundle) for more details. This value may be null.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="startPostponedEnterTransition--"></a>
<h3 class="api-name" id="startPostponedEnterTransition()">startPostponedEnterTransition</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#startPostponedEnterTransition()">startPostponedEnterTransition</a>():&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Begin postponed transitions after <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#postponeEnterTransition()">postponeEnterTransition</a></code> was called. If postponeEnterTransition() was called, you must call startPostponedEnterTransition() or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">FragmentManager#executePendingTransactions()</a></code> to complete the FragmentTransaction. If postponement was interrupted with <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#executePendingTransactions()">FragmentManager#executePendingTransactions()</a></code>, before <code>{@code startPostponedEnterTransition()}</code>, animations may not run or may execute improperly.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/android/app/Activity.html#startPostponedEnterTransition()">Activity</a></code></td>
<td width="100%"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="toString--"></a>
<h3 class="api-name" id="toString()">toString</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#toString()">toString</a>():&nbsp;<a href="/reference/kotlin/java/lang/String.html">String</a></pre>
</div>
<div><a name="unregisterForContextMenu-android.view.View-"></a>
<h3 class="api-name" id="unregisterForContextMenu(android.view.View)">unregisterForContextMenu</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html#unregisterForContextMenu(android.view.View)">unregisterForContextMenu</a>(view:&nbsp;View):&nbsp;<a href="/reference/kotlin/kotlin/Unit.html">Unit</a></pre>
<p>Prevents a context menu to be shown for the given view. This method will remove the OnCreateContextMenuListener on the view.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>view</code></td>
<td width="100%">
<p>The view that should stop showing a context menu.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForContextMenu(android.view.View)">registerForContextMenu</a></code></td>
<td width="100%"><code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#registerForContextMenu(android.view.View)">registerForContextMenu</a></code></td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>