blob: 518f20428c2420ff16993c376a2e00c0653881cd [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentHostCallback</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>FragmentHostCallback</h1>
{% setvar page_path %}androidx/fragment/app/FragmentHostCallback.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_java_switcher2.md" %}
<p>
<pre>public abstract class FragmentHostCallback&lt;E&gt; extends <a href="/reference/androidx/fragment/app/FragmentContainer.html">FragmentContainer</a></pre>
</p>
<div class="devsite-table-wrapper">
<table class="jd-inheritance-table">
<tbody>
<tr>
<td colspan="3"><a href="https://developer.android.com/reference/java/lang/Object.html">Object</a></td>
</tr>
<tr>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="2"><a href="/reference/androidx/fragment/app/FragmentContainer.html">FragmentContainer</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="1"><a href="/reference/androidx/fragment/app/FragmentHostCallback.html">FragmentHostCallback</a></td>
</tr>
</tbody>
</table>
</div>
<hr>
<p>Integration points with the Fragment host. </p>
<p>Fragments may be hosted by any object; such as an Activity. In order to host fragments, implement <code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html">FragmentHostCallback</a></code>, overriding the methods applicable to the host. </p>
<p>FragmentManager changes its behavior based on what optional interfaces your FragmentHostCallback implements. This includes the following: </p>
<ul>
<li><b>ActivityResultRegistryOwner</b>: Removes the need to override <code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartIntentSenderFromFragment(androidx.fragment.app.Fragment,android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">onStartIntentSenderFromFragment</a></code> or <code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onRequestPermissionsFromFragment(androidx.fragment.app.Fragment,java.lang.String[],int)">onRequestPermissionsFromFragment</a></code>.</li>
<li><b><code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html">FragmentOnAttachListener</a></code></b>: Removes the need to manually call <code><a href="/reference/androidx/fragment/app/FragmentManager.html#addFragmentOnAttachListener(androidx.fragment.app.FragmentOnAttachListener)">FragmentManager#addFragmentOnAttachListener</a></code> from your host in order to receive <code><a href="/reference/androidx/fragment/app/FragmentOnAttachListener.html#onAttachFragment(androidx.fragment.app.FragmentManager,androidx.fragment.app.Fragment)">FragmentOnAttachListener#onAttachFragment</a></code> callbacks for the <code><a href="/reference/androidx/fragment/app/FragmentController.html#getSupportFragmentManager()">FragmentController#getSupportFragmentManager()</a></code>.</li>
<li><b>androidx.activity.OnBackPressedDispatcherOwner</b>: Removes the need to manually call <code><a href="/reference/androidx/fragment/app/FragmentManager.html#popBackStackImmediate()">FragmentManager#popBackStackImmediate()</a></code> when handling the system back button.</li>
<li><b>androidx.lifecycle.ViewModelStoreOwner</b>: Removes the need for your <code><a href="/reference/androidx/fragment/app/FragmentController.html">FragmentController</a></code> to call <code><a href="/reference/androidx/fragment/app/FragmentController.html#retainNestedNonConfig()">FragmentController#retainNestedNonConfig()</a></code> or <code><a href="/reference/androidx/fragment/app/FragmentController.html#restoreAllState(android.os.Parcelable,androidx.fragment.app.FragmentManagerNonConfig)">FragmentController#restoreAllState(Parcelable, FragmentManagerNonConfig)</a></code>.</li>
</ul>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&lt;E&gt;</code></td>
<td width="100%">
<p>the type of object that's currently hosting the fragments. An instance of this class must be returned by <code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetHost()">onGetHost</a></code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Summary</h2>
<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/androidx/fragment/app/FragmentHostCallback.html#FragmentHostCallback(android.content.Context,android.os.Handler,int)">FragmentHostCallback</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Context&nbsp;context,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Handler&nbsp;handler,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;windowAnimations<br>)</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public methods</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onDump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">onDump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&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;args<br>)</code></div>
<p>Print internal state into the given stream.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;View</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onFindViewById(int)">onFindViewById</a>(int&nbsp;id)</code></div>
<p>Return the view with the given resource ID.</p>
</td>
</tr>
<tr>
<td><code>abstract @<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;E</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetHost()">onGetHost</a>()</code></div>
<p>Return the object that's currently hosting the fragment.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;LayoutInflater</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetLayoutInflater()">onGetLayoutInflater</a>()</code></div>
<p>Return a LayoutInflater.</p>
</td>
</tr>
<tr>
<td><code>int</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetWindowAnimations()">onGetWindowAnimations</a>()</code></div>
<p>Return the window animations.</p>
</td>
</tr>
<tr>
<td><code>boolean</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onHasView()">onHasView</a>()</code></div>
<p>Return <code>{@code true}</code> if the container holds any view.</p>
</td>
</tr>
<tr>
<td><code>boolean</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onHasWindowAnimations()">onHasWindowAnimations</a>()</code></div>
<p>Return <code>{@code true}</code> if there are window animations.</p>
</td>
</tr>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><span><del><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onRequestPermissionsFromFragment(androidx.fragment.app.Fragment,java.lang.String[],int)">onRequestPermissionsFromFragment</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&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;permissions,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode<br>)</code></div>
<p><strong>This method is deprecated.</strong>
<p>Have your FragmentHostCallback implement ActivityResultRegistryOwner to allow Fragments to use <code><a href="/reference/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">Fragment#registerForActivityResult(ActivityResultContract, ActivityResultCallback)</a></code> with RequestMultiplePermissions.</p>
</p>
</td>
</tr>
<tr>
<td><code>boolean</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onShouldSaveFragmentState(androidx.fragment.app.Fragment)">onShouldSaveFragmentState</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment)</code></div>
<p>Return <code>{@code true}</code> if the fragment's state needs to be saved.</p>
</td>
</tr>
<tr>
<td><code>boolean</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onShouldShowRequestPermissionRationale(java.lang.String)">onShouldShowRequestPermissionRationale</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;permission)</code></div>
<p>Checks whether to show permission rationale UI from a fragment.</p>
</td>
</tr>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int)">onStartActivityFromFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;Intent&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode<br>)</code></div>
<p>Starts a new Activity from the given fragment.</p>
</td>
</tr>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int,android.os.Bundle)">onStartActivityFromFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;Intent&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Bundle&nbsp;options<br>)</code></div>
<p>Starts a new Activity from the given fragment.</p>
</td>
</tr>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><span><del><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartIntentSenderFromFragment(androidx.fragment.app.Fragment,android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">onStartIntentSenderFromFragment</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;IntentSender&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Intent&nbsp;fillInIntent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;flagsMask,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;flagsValues,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;extraFlags,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Bundle&nbsp;options<br>)</code></div>
<p><strong>This method is deprecated.</strong>
<p>Have your FragmentHostCallback implement ActivityResultRegistryOwner to allow Fragments to use <code><a href="/reference/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">Fragment#registerForActivityResult(ActivityResultContract, ActivityResultCallback)</a></code> with StartIntentSenderForResult.</p>
</p>
</td>
</tr>
<tr>
<td><code>void</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onSupportInvalidateOptionsMenu()">onSupportInvalidateOptionsMenu</a>()</code></div>
<p>Invalidates the activity's options menu.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive" id="inhmethods">
<thead>
<tr>
<th colspan="2"><h3>Inherited methods</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><devsite-expandable><span class="expand-control">From class <a href="/reference/androidx/fragment/app/FragmentContainer.html">FragmentContainer</a></span>
<div class="devsite-table-wrapper">
<table class="responsive">
<tbody>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code></td>
<td width="100%">
<div><code><span><del><a href="/reference/androidx/fragment/app/FragmentContainer.html#instantiate(android.content.Context,java.lang.String,android.os.Bundle)">instantiate</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Context&nbsp;context,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;className,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Bundle&nbsp;arguments<br>)</code></div>
<p><strong>This method is deprecated.</strong>
<p>Use <code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentFactory(androidx.fragment.app.FragmentFactory)">FragmentManager#setFragmentFactory</a></code> to control how Fragments are instantiated.</p>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</devsite-expandable> </td>
</tr>
</tbody>
</table>
</div>
<h2>Public constructors</h2>
<div><a name="FragmentHostCallback(android.content.Context, android.os.Handler, int)"></a><a name="FragmentHostCallback-android.content.Context-android.os.Handler-int-"></a>
<h3 class="api-name" id="FragmentHostCallback(android.content.Context,android.os.Handler,int)">FragmentHostCallback</h3>
<pre class="api-signature no-pretty-print">public&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#FragmentHostCallback(android.content.Context,android.os.Handler,int)">FragmentHostCallback</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Context&nbsp;context,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Handler&nbsp;handler,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;windowAnimations<br>)</pre>
</div>
<h2>Public methods</h2>
<div><a name="onDump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])"></a><a name="onDump-java.lang.String-java.io.FileDescriptor-java.io.PrintWriter-java.lang.String[]-"></a>
<h3 class="api-name" id="onDump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">onDump</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onDump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])">onDump</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&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;args<br>)</pre>
<p>Print internal state into the given stream.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;prefix</code></td>
<td width="100%">
<p>Desired prefix to prepend at each line of output.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;<a href="https://developer.android.com/reference/java/io/FileDescriptor.html">FileDescriptor</a>&nbsp;fd</code></td>
<td width="100%">
<p>The raw file descriptor that the dump is being sent to.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a>&nbsp;writer</code></td>
<td width="100%">
<p>The PrintWriter to which you should dump your state. This will be closed for you after you return.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&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;args</code></td>
<td width="100%">
<p>additional arguments to the dump request.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="onFindViewById-int-"></a>
<h3 class="api-name" id="onFindViewById(int)">onFindViewById</h3>
<pre class="api-signature no-pretty-print">@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a><br>public&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;View&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onFindViewById(int)">onFindViewById</a>(int&nbsp;id)</pre>
<p>Return the view with the given resource ID. May return <code>{@code null}</code> if the view is not a child of this container.</p>
</div>
<div><a name="onGetHost--"></a>
<h3 class="api-name" id="onGetHost()">onGetHost</h3>
<pre class="api-signature no-pretty-print">@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a><br>public&nbsp;abstract&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;E&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetHost()">onGetHost</a>()</pre>
<p>Return the object that's currently hosting the fragment. If a <code><a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a></code> is hosted by a <code><a href="/reference/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a></code>, the object returned here should be the same object returned from <code><a href="/reference/androidx/fragment/app/Fragment.html#getActivity()">Fragment#getActivity()</a></code>.</p>
</div>
<div><a name="onGetLayoutInflater--"></a>
<h3 class="api-name" id="onGetLayoutInflater()">onGetLayoutInflater</h3>
<pre class="api-signature no-pretty-print">@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a><br>public&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;LayoutInflater&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetLayoutInflater()">onGetLayoutInflater</a>()</pre>
<p>Return a LayoutInflater. See Activity#getLayoutInflater().</p>
</div>
<div><a name="onGetWindowAnimations--"></a>
<h3 class="api-name" id="onGetWindowAnimations()">onGetWindowAnimations</h3>
<pre class="api-signature no-pretty-print">public&nbsp;int&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onGetWindowAnimations()">onGetWindowAnimations</a>()</pre>
<p>Return the window animations.</p>
</div>
<div><a name="onHasView--"></a>
<h3 class="api-name" id="onHasView()">onHasView</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onHasView()">onHasView</a>()</pre>
<p>Return <code>{@code true}</code> if the container holds any view.</p>
</div>
<div><a name="onHasWindowAnimations--"></a>
<h3 class="api-name" id="onHasWindowAnimations()">onHasWindowAnimations</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onHasWindowAnimations()">onHasWindowAnimations</a>()</pre>
<p>Return <code>{@code true}</code> if there are window animations.</p>
</div>
<div><a name="onRequestPermissionsFromFragment(androidx.fragment.app.Fragment, java.lang.String[], int)"></a><a name="onRequestPermissionsFromFragment-androidx.fragment.app.Fragment-java.lang.String[]-int-"></a>
<h3 class="api-name" id="onRequestPermissionsFromFragment(androidx.fragment.app.Fragment,java.lang.String[],int)">onRequestPermissionsFromFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<span><del><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onRequestPermissionsFromFragment(androidx.fragment.app.Fragment,java.lang.String[],int)">onRequestPermissionsFromFragment</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&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;permissions,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode<br>)</pre>
<aside class="caution"><strong>This method is deprecated.</strong><br>
<p>Have your FragmentHostCallback implement ActivityResultRegistryOwner to allow Fragments to use <code><a href="/reference/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">Fragment#registerForActivityResult(ActivityResultContract, ActivityResultCallback)</a></code> with RequestMultiplePermissions. This method will still be called when Fragments call the deprecated <code>requestPermissions()</code> method.</p>
</aside>
<p>Requests permissions from the given fragment. See FragmentActivity#requestPermissions(String[], int)</p>
</div>
<div><a name="onShouldSaveFragmentState-androidx.fragment.app.Fragment-"></a>
<h3 class="api-name" id="onShouldSaveFragmentState(androidx.fragment.app.Fragment)">onShouldSaveFragmentState</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onShouldSaveFragmentState(androidx.fragment.app.Fragment)">onShouldSaveFragmentState</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment)</pre>
<p>Return <code>{@code true}</code> if the fragment's state needs to be saved.</p>
</div>
<div><a name="onShouldShowRequestPermissionRationale-java.lang.String-"></a>
<h3 class="api-name" id="onShouldShowRequestPermissionRationale(java.lang.String)">onShouldShowRequestPermissionRationale</h3>
<pre class="api-signature no-pretty-print">public&nbsp;boolean&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onShouldShowRequestPermissionRationale(java.lang.String)">onShouldShowRequestPermissionRationale</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html">String</a>&nbsp;permission)</pre>
<p>Checks whether to show permission rationale UI from a fragment. See FragmentActivity#shouldShowRequestPermissionRationale(String)</p>
</div>
<div><a name="onStartActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent, int)"></a><a name="onStartActivityFromFragment-androidx.fragment.app.Fragment-android.content.Intent-int-"></a>
<h3 class="api-name" id="onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int)">onStartActivityFromFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int)">onStartActivityFromFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;Intent&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode<br>)</pre>
<p>Starts a new Activity from the given fragment. See FragmentActivity#startActivityForResult(Intent, int).</p>
</div>
<div><a name="onStartActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent, int, android.os.Bundle)"></a><a name="onStartActivityFromFragment-androidx.fragment.app.Fragment-android.content.Intent-int-android.os.Bundle-"></a>
<h3 class="api-name" id="onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int,android.os.Bundle)">onStartActivityFromFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartActivityFromFragment(androidx.fragment.app.Fragment,android.content.Intent,int,android.os.Bundle)">onStartActivityFromFragment</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;Intent&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Bundle&nbsp;options<br>)</pre>
<p>Starts a new Activity from the given fragment. See FragmentActivity#startActivityForResult(Intent, int, Bundle).</p>
</div>
<div><a name="onStartIntentSenderFromFragment(androidx.fragment.app.Fragment, android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)"></a><a name="onStartIntentSenderFromFragment-androidx.fragment.app.Fragment-android.content.IntentSender-int-android.content.Intent-int-int-int-android.os.Bundle-"></a>
<h3 class="api-name" id="onStartIntentSenderFromFragment(androidx.fragment.app.Fragment,android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">onStartIntentSenderFromFragment</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<span><del><a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onStartIntentSenderFromFragment(androidx.fragment.app.Fragment,android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle)">onStartIntentSenderFromFragment</a></del></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;<a href="/reference/androidx/fragment/app/Fragment.html">Fragment</a>&nbsp;fragment,<br>&nbsp;&nbsp;&nbsp;&nbsp;IntentSender&nbsp;intent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;requestCode,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Intent&nbsp;fillInIntent,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;flagsMask,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;flagsValues,<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;extraFlags,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/Nullable.html">Nullable</a>&nbsp;Bundle&nbsp;options<br>)</pre>
<aside class="caution"><strong>This method is deprecated.</strong><br>
<p>Have your FragmentHostCallback implement ActivityResultRegistryOwner to allow Fragments to use <code><a href="/reference/androidx/fragment/app/Fragment.html#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract&lt;I,O&gt;,androidx.activity.result.ActivityResultCallback&lt;O&gt;)">Fragment#registerForActivityResult(ActivityResultContract, ActivityResultCallback)</a></code> with StartIntentSenderForResult. This method will still be called when Fragments call the deprecated <code>startIntentSenderForResult()</code> method.</p>
</aside>
<p>Starts a new IntentSender from the given fragment. See Activity#startIntentSender(IntentSender, Intent, int, int, int, Bundle).</p>
</div>
<div><a name="onSupportInvalidateOptionsMenu--"></a>
<h3 class="api-name" id="onSupportInvalidateOptionsMenu()">onSupportInvalidateOptionsMenu</h3>
<pre class="api-signature no-pretty-print">public&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentHostCallback.html#onSupportInvalidateOptionsMenu()">onSupportInvalidateOptionsMenu</a>()</pre>
<p>Invalidates the activity's options menu. See <code><a href="/reference/androidx/fragment/app/FragmentActivity.html#supportInvalidateOptionsMenu()">FragmentActivity#supportInvalidateOptionsMenu()</a></code></p>
</div>
</body>
</html>