blob: 82313ced1e7731bc48a8c86e8a19269a079b9d76 [file] [log] [blame]
<html devsite="true">
<head>
<title>DialogFragment</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>DialogFragment</h1>
{% setvar page_path %}androidx/fragment/app/DialogFragment.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>class DialogFragment : <a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
</p>
<div class="devsite-table-wrapper">
<table class="jd-inheritance-table">
<tbody>
<tr>
<td colspan="3"><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a></td>
</tr>
<tr>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="2"><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="1"><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html">DialogFragment</a></td>
</tr>
</tbody>
</table>
</div>
<hr>
<p>Static library support version of the framework's android.app.DialogFragment. 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 SDK documentation for a class overview.</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Constants</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NORMAL()">STYLE_NORMAL</a></code></div>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: a basic, normal dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a></code></div>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: don't draw any frame at all; the view hierarchy 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> is entirely responsible for drawing the dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_INPUT()">STYLE_NO_INPUT</a></code></div>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: like <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a></code>, but also disables all input to the dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_TITLE()">STYLE_NO_TITLE</a></code></div>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: don't include a title area.</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/DialogFragment.html#DialogFragment()">DialogFragment</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/DialogFragment.html#DialogFragment(int)">DialogFragment</a>(contentLayoutId:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismiss()">dismiss</a>()</code></div>
<p>Dismiss the fragment and its dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismissAllowingStateLoss()">dismissAllowingStateLoss</a>()</code></div>
<p>Version of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismiss()">dismiss</a></code> that uses <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commitAllowingStateLoss()">FragmentTransaction.commitAllowingStateLoss()</a></code>.</p>
</td>
</tr>
<tr>
<td><code>Dialog?</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getDialog()">getDialog</a>()</code></div>
<p>Return the Dialog this fragment is currently controlling.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getShowsDialog()">getShowsDialog</a>()</code></div>
<p>Return the current value of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setShowsDialog(boolean)">setShowsDialog</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getTheme()">getTheme</a>()</code></div>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#isCancelable()">isCancelable</a>()</code></div>
<p>Return the current value of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setCancelable(boolean)">setCancelable</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCancel(android.content.DialogInterface)">onCancel</a>(dialog:&nbsp;DialogInterface)</code></div>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.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>Dialog</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreateDialog(android.os.Bundle)">onCreateDialog</a>(savedInstanceState:&nbsp;Bundle?)</code></div>
<p>Override to build your own custom Dialog container.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDestroyView()">onDestroyView</a>()</code></div>
<p>Remove dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDetach()">onDetach</a>()</code></div>
<p>Called when the fragment is no longer attached to its activity.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDismiss(android.content.DialogInterface)">onDismiss</a>(dialog:&nbsp;DialogInterface)</code></div>
</td>
</tr>
<tr>
<td><code>LayoutInflater</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onStart()">onStart</a>()</code></div>
<p>Called when the Fragment is visible to the user.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onStop()">onStop</a>()</code></div>
<p>Called when the Fragment is no longer started.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.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>Dialog</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#requireDialog()">requireDialog</a>()</code></div>
<p>Return the Dialog this fragment is currently controlling.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setCancelable(boolean)">setCancelable</a>(cancelable:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>)</code></div>
<p>Control whether the shown Dialog is cancelable.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setShowsDialog(boolean)">setShowsDialog</a>(showsDialog:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>)</code></div>
<p>Controls whether this fragment should be shown in a dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a>(style:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;theme:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Call to customize the basic appearance and behavior of the fragment's dialog.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#show(androidx.fragment.app.FragmentManager,java.lang.String)">show</a>(manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?)</code></div>
<p>Display the dialog, adding the fragment to the given FragmentManager.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#show(androidx.fragment.app.FragmentTransaction,java.lang.String)">show</a>(transaction:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?)</code></div>
<p>Display the dialog, adding the fragment using an existing transaction and then <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commit()">committing</a></code> the transaction.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#showNow(androidx.fragment.app.FragmentManager,java.lang.String)">showNow</a>(manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?)</code></div>
<p>Display the dialog, immediately adding the fragment to the given FragmentManager.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive" id="inhmethods">
<thead>
<tr>
<th colspan="2"><h3>Inherited functions</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><devsite-expandable><span class="expand-control">From class <a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></span>
<div class="devsite-table-wrapper">
<table class="responsive">
<tbody>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://developer.android.com/reference/java/lang/String.html">String</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fd:&nbsp;<a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>?,<br>&nbsp;&nbsp;&nbsp;&nbsp;writer:&nbsp;<a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;args:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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>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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://developer.android.com/reference/java/lang/IllegalStateException.html">IllegalStateException</a></code> if the FragmentManager is null.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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>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(this).</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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;formatArgs:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://developer.android.com/reference/java/util/Formatter.html">java.util.Formatter</a></code> and format.</p>
</td>
</tr>
<tr>
<td><code><a href="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://developer.android.com/reference/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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;resultCode:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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 callback.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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>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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;enter:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;enter:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>,&nbsp;nextAnim:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Called when a fragment loads an animator.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;permissions:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;grantResults:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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 callback.</p>
</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a>,&nbsp;timeUnit:&nbsp;<a href="https://developer.android.com/reference/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>&lt;I,&nbsp;O&gt; <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>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>&lt;I,&nbsp;O&gt; <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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&gt;,&nbsp;requestCode:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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 callback.</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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;fillInIntent:&nbsp;Intent?,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsMask:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;flagsValues:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;extraFlags:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="https://developer.android.com/reference/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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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>
</devsite-expandable> </td>
</tr>
</tbody>
</table>
</div>
<h2>Constants</h2>
<div><a name="getSTYLE_NORMAL()"></a><a name="setSTYLE_NORMAL()"></a><a name="getSTYLE_NORMAL--"></a><a name="setSTYLE_NORMAL--"></a>
<h3 class="api-name" id="STYLE_NORMAL()">STYLE_NORMAL</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NORMAL()">STYLE_NORMAL</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: a basic, normal dialog.</p>
</div>
<div><a name="getSTYLE_NO_FRAME()"></a><a name="setSTYLE_NO_FRAME()"></a><a name="getSTYLE_NO_FRAME--"></a><a name="setSTYLE_NO_FRAME--"></a>
<h3 class="api-name" id="STYLE_NO_FRAME()">STYLE_NO_FRAME</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: don't draw any frame at all; the view hierarchy 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> is entirely responsible for drawing the dialog.</p>
</div>
<div><a name="getSTYLE_NO_INPUT()"></a><a name="setSTYLE_NO_INPUT()"></a><a name="getSTYLE_NO_INPUT--"></a><a name="setSTYLE_NO_INPUT--"></a>
<h3 class="api-name" id="STYLE_NO_INPUT()">STYLE_NO_INPUT</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_INPUT()">STYLE_NO_INPUT</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: like <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a></code>, but also disables all input to the dialog. The user can not touch it, and its window will not receive input focus.</p>
</div>
<div><a name="getSTYLE_NO_TITLE()"></a><a name="setSTYLE_NO_TITLE()"></a><a name="getSTYLE_NO_TITLE--"></a><a name="setSTYLE_NO_TITLE--"></a>
<h3 class="api-name" id="STYLE_NO_TITLE()">STYLE_NO_TITLE</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_TITLE()">STYLE_NO_TITLE</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Style for <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a></code>: don't include a title area.</p>
</div>
<h2>Public constructors</h2>
<div><a name="DialogFragment--"></a>
<h3 class="api-name" id="DialogFragment()">DialogFragment</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#DialogFragment()">DialogFragment</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)">set a custom 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/DialogFragment.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.</p>
</div>
<div><a name="DialogFragment-int-"></a>
<h3 class="api-name" id="DialogFragment(int)">DialogFragment</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#DialogFragment(int)">DialogFragment</a>(contentLayoutId:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.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 MyDialogFragment extends DialogFragment {
public MyDialogFragment() {
super(R.layout.dialog_fragment_main);
}
}
</pre>
You must <code><a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">set a custom 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/DialogFragment.html#DialogFragment()">DialogFragment</a></code></td>
<td width="100%">
<p>#DialogFragment()</p>
</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%">
<p>#onCreateView(LayoutInflater, ViewGroup, Bundle)</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public functions</h2>
<div><a name="dismiss--"></a>
<h3 class="api-name" id="dismiss()">dismiss</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismiss()">dismiss</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Dismiss the fragment and its dialog. If the fragment was added to the back stack, all back stack state up to and including this entry will be popped. Otherwise, a new transaction will be committed to remove the fragment.</p>
</div>
<div><a name="dismissAllowingStateLoss--"></a>
<h3 class="api-name" id="dismissAllowingStateLoss()">dismissAllowingStateLoss</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismissAllowingStateLoss()">dismissAllowingStateLoss</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Version of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#dismiss()">dismiss</a></code> that uses <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commitAllowingStateLoss()">FragmentTransaction.commitAllowingStateLoss()</a></code>. See linked documentation for further details.</p>
</div>
<div><a name="getDialog--"></a>
<h3 class="api-name" id="getDialog()">getDialog</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getDialog()">getDialog</a>():&nbsp;Dialog?</pre>
<p>Return the Dialog this fragment is currently controlling.</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/DialogFragment.html#requireDialog()">requireDialog</a></code></td>
<td width="100%">
<p>#requireDialog()</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getShowsDialog--"></a>
<h3 class="api-name" id="getShowsDialog()">getShowsDialog</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getShowsDialog()">getShowsDialog</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></pre>
<p>Return the current value of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setShowsDialog(boolean)">setShowsDialog</a></code>.</p>
</div>
<div><a name="getTheme--"></a>
<h3 class="api-name" id="getTheme()">getTheme</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#getTheme()">getTheme</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
</div>
<div><a name="isCancelable--"></a>
<h3 class="api-name" id="isCancelable()">isCancelable</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#isCancelable()">isCancelable</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></pre>
<p>Return the current value of <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setCancelable(boolean)">setCancelable</a></code>.</p>
</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/DialogFragment.html#onAttach(android.content.Context)">onAttach</a>(context:&nbsp;Context):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="onCancel-android.content.DialogInterface-"></a>
<h3 class="api-name" id="onCancel(android.content.DialogInterface)">onCancel</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCancel(android.content.DialogInterface)">onCancel</a>(dialog:&nbsp;DialogInterface):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</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/DialogFragment.html#onCreate(android.os.Bundle)">onCreate</a>(savedInstanceState:&nbsp;Bundle?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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:&nbsp;Bundle?</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="onCreateDialog-android.os.Bundle-"></a>
<h3 class="api-name" id="onCreateDialog(android.os.Bundle)">onCreateDialog</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreateDialog(android.os.Bundle)">onCreateDialog</a>(savedInstanceState:&nbsp;Bundle?):&nbsp;Dialog</pre>
<p>Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code> does not need to be implemented since the AlertDialog takes care of its own content. </p>
<p>This method will be called after <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreate(android.os.Bundle)">onCreate</a></code> and immediately before <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)">onCreateView</a></code>. The default implementation simply instantiates and returns a Dialog class. </p>
<p><em>Note: DialogFragment own the Dialog.setOnCancelListener and Dialog.setOnDismissListener callbacks. You must not set them yourself.</em>To find out about these events, override <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCancel(android.content.DialogInterface)">onCancel</a></code> and <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDismiss(android.content.DialogInterface)">onDismiss</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Dialog</code></td>
<td width="100%">
<p>Return a new Dialog instance to be displayed by the 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:&nbsp;Bundle?</code></td>
<td width="100%">
<p>The last saved instance state of the Fragment, or null if this is a freshly created Fragment.</p>
</td>
</tr>
</tbody>
</table>
</div>
</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/DialogFragment.html#onDestroyView()">onDestroyView</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Remove dialog.</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/DialogFragment.html#onDetach()">onDetach</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="onDismiss-android.content.DialogInterface-"></a>
<h3 class="api-name" id="onDismiss(android.content.DialogInterface)">onDismiss</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDismiss(android.content.DialogInterface)">onDismiss</a>(dialog:&nbsp;DialogInterface):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</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/DialogFragment.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>
<p>If this is called from within <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreateDialog(android.os.Bundle)">onCreateDialog</a></code>, the layout inflater from <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#onGetLayoutInflater(android.os.Bundle)">Fragment#onGetLayoutInflater(Bundle)</a></code>, without the dialog theme, will be returned.</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/DialogFragment.html#onSaveInstanceState(android.os.Bundle)">onSaveInstanceState</a>(outState:&nbsp;Bundle):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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:&nbsp;Bundle</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/DialogFragment.html#onStart()">onStart</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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/DialogFragment.html#onStop()">onStop</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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="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/DialogFragment.html#onViewStateRestored(android.os.Bundle)">onViewStateRestored</a>(savedInstanceState:&nbsp;Bundle?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.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:&nbsp;Bundle?</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="requireDialog--"></a>
<h3 class="api-name" id="requireDialog()">requireDialog</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#requireDialog()">requireDialog</a>():&nbsp;Dialog</pre>
<p>Return the Dialog this fragment is currently controlling.</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 the Dialog has not yet been created (before <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreateDialog(android.os.Bundle)">onCreateDialog</a></code>) or has been destroyed (after <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onDestroyView()">onDestroyView</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/DialogFragment.html#getDialog()">getDialog</a></code></td>
<td width="100%">
<p>#getDialog()</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setCancelable-boolean-"></a>
<h3 class="api-name" id="setCancelable(boolean)">setCancelable</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setCancelable(boolean)">setCancelable</a>(cancelable:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Control whether the shown Dialog is cancelable. Use this instead of directly calling Dialog.setCancelable(boolean), because DialogFragment needs to change its behavior based on this.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>cancelable:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></code></td>
<td width="100%">
<p>If true, the dialog is cancelable. The default is true.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setShowsDialog-boolean-"></a>
<h3 class="api-name" id="setShowsDialog(boolean)">setShowsDialog</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setShowsDialog(boolean)">setShowsDialog</a>(showsDialog:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Controls whether this fragment should be shown in a dialog. If not set, no Dialog will be created and the fragment's view hierarchy will thus not be added to it. This allows you to instead use it as a normal fragment (embedded inside of its activity). </p>
<p>This is normally set for you based on whether the fragment is associated with a container view ID passed to <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#add(int,androidx.fragment.app.Fragment)">FragmentTransaction.add(int, Fragment)</a></code>. If the fragment was added with a container, setShowsDialog will be initialized to false; otherwise, it will be true. </p>
<p>If calling this manually, it should be called in <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#onCreate(android.os.Bundle)">onCreate</a></code> as calling it any later will have no effect.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>showsDialog:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></code></td>
<td width="100%">
<p>If true, the fragment will be displayed in a Dialog. If false, no Dialog will be created and the fragment's view hierarchy left undisturbed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="setStyle(int, int)"></a><a name="setStyle-int-int-"></a>
<h3 class="api-name" id="setStyle(int,int)">setStyle</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#setStyle(int,int)">setStyle</a>(style:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;theme:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Call to customize the basic appearance and behavior of the fragment's dialog. This can be used for some common dialog behaviors, taking care of selecting flags, theme, and other options for you. The same effect can be achieve by manually setting Dialog and Window attributes yourself. Calling this after the fragment's Dialog is created will have no effect.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>style:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<p>Selects a standard style: may be <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NORMAL()">STYLE_NORMAL</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_TITLE()">STYLE_NO_TITLE</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_INPUT()">STYLE_NO_INPUT</a></code>. Value is <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NORMAL()">STYLE_NORMAL</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_TITLE()">STYLE_NO_TITLE</a></code>, <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_FRAME()">STYLE_NO_FRAME</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#STYLE_NO_INPUT()">STYLE_NO_INPUT</a></code></p>
</td>
</tr>
<tr>
<td><code>theme:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<p>Optional custom theme. If 0, an appropriate theme (based on the style) will be selected for you.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="show(androidx.fragment.app.FragmentManager, java.lang.String)"></a><a name="show-androidx.fragment.app.FragmentManager-java.lang.String-"></a>
<h3 class="api-name" id="show(androidx.fragment.app.FragmentManager,java.lang.String)">show</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#show(androidx.fragment.app.FragmentManager,java.lang.String)">show</a>(manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Display the dialog, adding the fragment to the given FragmentManager. This is a convenience for explicitly creating a transaction, adding the fragment to it with the given tag, and <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commit()">committing</a></code> it. This does <em>not</em> add the transaction to the fragment back stack. When the fragment is dismissed, a new transaction will be executed to remove it from the activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<p>The FragmentManager this fragment will be added to.</p>
</td>
</tr>
<tr>
<td><code>tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?</code></td>
<td width="100%">
<p>The tag for this fragment, as per <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#add(androidx.fragment.app.Fragment,java.lang.String)">FragmentTransaction.add</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="show(androidx.fragment.app.FragmentTransaction, java.lang.String)"></a><a name="show-androidx.fragment.app.FragmentTransaction-java.lang.String-"></a>
<h3 class="api-name" id="show(androidx.fragment.app.FragmentTransaction,java.lang.String)">show</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#show(androidx.fragment.app.FragmentTransaction,java.lang.String)">show</a>(transaction:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Display the dialog, adding the fragment using an existing transaction and then <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commit()">committing</a></code> the transaction.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<p>Returns the identifier of the committed transaction, as per <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commit()">FragmentTransaction.commit()</a></code>.</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>transaction:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html">FragmentTransaction</a></code></td>
<td width="100%">
<p>An existing transaction in which to add the fragment.</p>
</td>
</tr>
<tr>
<td><code>tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?</code></td>
<td width="100%">
<p>The tag for this fragment, as per <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#add(androidx.fragment.app.Fragment,java.lang.String)">FragmentTransaction.add</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="showNow(androidx.fragment.app.FragmentManager, java.lang.String)"></a><a name="showNow-androidx.fragment.app.FragmentManager-java.lang.String-"></a>
<h3 class="api-name" id="showNow(androidx.fragment.app.FragmentManager,java.lang.String)">showNow</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/DialogFragment.html#showNow(androidx.fragment.app.FragmentManager,java.lang.String)">showNow</a>(manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<p>Display the dialog, immediately adding the fragment to the given FragmentManager. This is a convenience for explicitly creating a transaction, adding the fragment to it with the given tag, and calling <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#commitNow()">FragmentTransaction#commitNow()</a></code>. This does <em>not</em> add the transaction to the fragment back stack. When the fragment is dismissed, a new transaction will be executed to remove it from the activity.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<p>The FragmentManager this fragment will be added to.</p>
</td>
</tr>
<tr>
<td><code>tag:&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>?</code></td>
<td width="100%">
<p>The tag for this fragment, as per <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#add(androidx.fragment.app.Fragment,java.lang.String)">FragmentTransaction.add</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>