blob: ecb1f0020a2fbfe3a0a22de41b04dbb73ac2bdc5 [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentResultListener</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>FragmentResultListener</h1>
{% setvar page_path %}androidx/fragment/app/FragmentResultListener.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_java_switcher2.md" %}
<p>
<pre>interface FragmentResultListener</pre>
</p>
<hr>
<p>Listener for handling fragment results. This object should be passed to <code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">FragmentManager#setFragmentResultListener(String, LifecycleOwner, FragmentResultListener)</a></code> and it will listen for results with the same key that are passed into <code><a href="/reference/androidx/fragment/app/FragmentManager.html#setFragmentResult(java.lang.String,android.os.Bundle)">FragmentManager#setFragmentResult(String, Bundle)</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">See also</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="/reference/androidx/fragment/app/FragmentResultOwner.html#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)">setFragmentResultListener</a></code></td>
<td width="100%">
<p>androidx.fragment.app.FragmentResultOwner#setFragmentResultListener</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public methods</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>abstract void</code></td>
<td width="100%">
<div><code><a href="/reference/androidx/fragment/app/FragmentResultListener.html#onFragmentResult(java.lang.String,android.os.Bundle)">onFragmentResult</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;requestKey,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Bundle&nbsp;result)</code></div>
<p>Callback used to handle results passed between fragments.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public methods</h2>
<div><a name="onFragmentResult(java.lang.String, android.os.Bundle)"></a><a name="onFragmentResult-java.lang.String-android.os.Bundle-"></a>
<h3 class="api-name" id="onFragmentResult(java.lang.String,android.os.Bundle)">onFragmentResult</h3>
<pre class="api-signature no-pretty-print">public&nbsp;abstract&nbsp;void&nbsp;<a href="/reference/androidx/fragment/app/FragmentResultListener.html#onFragmentResult(java.lang.String,android.os.Bundle)">onFragmentResult</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;requestKey,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Bundle&nbsp;result)</pre>
<p>Callback used to handle results passed between fragments.</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;requestKey</code></td>
<td width="100%">
<p>key used to store the result</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a>&nbsp;Bundle&nbsp;result</code></td>
<td width="100%">
<p>result passed to the callback</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>