blob: f426bae5f4ea6008bc46229f72462611aec92371 [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentStatePagerAdapter</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>FragmentStatePagerAdapter</h1>
{% setvar page_path %}androidx/fragment/app/FragmentStatePagerAdapter.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>abstract class FragmentStatePagerAdapter</pre>
</p>
<hr>
<aside class="caution"><strong>This class is deprecated.</strong><br>
<p>Switch to androidx.viewpager2.widget.ViewPager2 and use androidx.viewpager2.adapter.FragmentStateAdapter instead.</p>
</aside>
<p>Implementation of PagerAdapter that uses a <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code> to manage each page. This class also handles saving and restoring of fragment's state. </p>
<p>This version of the pager is more useful when there are a large number of pages, working more like a list view. When pages are not visible to the user, their entire fragment may be destroyed, only keeping the saved state of that fragment. This allows the pager to hold on to much less memory associated with each visited page as compared to <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html">FragmentPagerAdapter</a></code> at the cost of potentially more overhead when switching between pages. </p>
<p>When using FragmentPagerAdapter the host ViewPager must have a valid ID set.</p>
<p>Subclasses only need to implement <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#getItem(int)">getItem</a></code> and getCount to have a working adapter. </p>
<p>Here is an example implementation of a pager containing fragments of lists: {@sample frameworks/support/samples/Support4Demos/src/main/java/com/example/android/supportv4/app/FragmentStatePagerSupport.java * complete} </p>
<p>The <code>R.layout.fragment_pager</code> resource of the top-level fragment is: {@sample frameworks/support/samples/Support4Demos/src/main/res/layout/fragment_pager.xml * complete} </p>
<p>The <code>R.layout.fragment_pager_list</code> resource containing each individual fragment's layout is: {@sample frameworks/support/samples/Support4Demos/src/main/res/layout/fragment_pager_list.xml * complete}</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/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code></div>
<p>Indicates that only the current fragment will be in the Lifecycle.State#RESUMED state.</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/FragmentStatePagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a></code></div>
<p><strong>This property is deprecated.</strong>
<p>This behavior relies on the deprecated <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">Fragment#setUserVisibleHint(boolean)</a></code> API.</p>
</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><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager)">FragmentStatePagerAdapter</a></del></span>(fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a></code> with <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code></p>
</p>
</td>
</tr>
<tr>
<td>
<div><code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a>(fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;behavior:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Constructor for <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html">FragmentStatePagerAdapter</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/FragmentStatePagerAdapter.html#destroyItem(android.view.ViewGroup,int,java.lang.Object)">destroyItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</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/FragmentStatePagerAdapter.html#finishUpdate(android.view.ViewGroup)">finishUpdate</a>(container:&nbsp;ViewGroup)</code></div>
</td>
</tr>
<tr>
<td><code>abstract <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/FragmentStatePagerAdapter.html#getItem(int)">getItem</a>(position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Return the Fragment associated with a specified position.</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/FragmentStatePagerAdapter.html#instantiateItem(android.view.ViewGroup,int)">instantiateItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</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/FragmentStatePagerAdapter.html#isViewFromObject(android.view.View,java.lang.Object)">isViewFromObject</a>(view:&nbsp;View,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</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/FragmentStatePagerAdapter.html#restoreState(android.os.Parcelable,java.lang.ClassLoader)">restoreState</a>(state:&nbsp;Parcelable?,&nbsp;loader:&nbsp;<a href="https://developer.android.com/reference/java/lang/ClassLoader.html">ClassLoader</a>?)</code></div>
</td>
</tr>
<tr>
<td><code>Parcelable?</code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#saveState()">saveState</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/FragmentStatePagerAdapter.html#setPrimaryItem(android.view.ViewGroup,int,java.lang.Object)">setPrimaryItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</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/FragmentStatePagerAdapter.html#startUpdate(android.view.ViewGroup)">startUpdate</a>(container:&nbsp;ViewGroup)</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Constants</h2>
<div><a name="getBEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()"></a><a name="setBEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()"></a><a name="getBEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT--"></a><a name="setBEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT--"></a>
<h3 class="api-name" id="BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>Indicates that only the current fragment will be in the Lifecycle.State#RESUMED state. All other Fragments are capped at Lifecycle.State#STARTED.</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/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a></code></td>
<td width="100%">
<p>#FragmentStatePagerAdapter(FragmentManager, int)</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="getBEHAVIOR_SET_USER_VISIBLE_HINT()"></a><a name="setBEHAVIOR_SET_USER_VISIBLE_HINT()"></a><a name="getBEHAVIOR_SET_USER_VISIBLE_HINT--"></a><a name="setBEHAVIOR_SET_USER_VISIBLE_HINT--"></a>
<h3 class="api-name" id="BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<aside class="caution"><strong>This property is deprecated.</strong><br>
<p>This behavior relies on the deprecated <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">Fragment#setUserVisibleHint(boolean)</a></code> API. Use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code> to switch to its replacement, <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTransaction.html#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)">FragmentTransaction#setMaxLifecycle</a></code>.</p>
</aside>
<p>Indicates that <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">Fragment#setUserVisibleHint(boolean)</a></code> will be called when the current fragment changes.</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/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a></code></td>
<td width="100%">
<p>#FragmentStatePagerAdapter(FragmentManager, int)</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public constructors</h2>
<div><a name="FragmentStatePagerAdapter-androidx.fragment.app.FragmentManager-"></a>
<h3 class="api-name" id="FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager)">FragmentStatePagerAdapter</h3>
<pre class="api-signature no-pretty-print"><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager)">FragmentStatePagerAdapter</a></del></span>(fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>)</pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>use <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a></code> with <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code></p>
</aside>
<p>Constructor for <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html">FragmentStatePagerAdapter</a></code> that sets the fragment manager for the adapter. This is the equivalent of calling <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a></code> and passing in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a></code>. </p>
<p>Fragments will have <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">Fragment#setUserVisibleHint(boolean)</a></code> called whenever the current Fragment changes.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<p>fragment manager that will interact with this adapter</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><a name="FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager, int)"></a><a name="FragmentStatePagerAdapter-androidx.fragment.app.FragmentManager-int-"></a>
<h3 class="api-name" id="FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentStatePagerAdapter</a>(fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;behavior:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</pre>
<p>Constructor for <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html">FragmentStatePagerAdapter</a></code>. If <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code> is passed in, then only the current Fragment is in the Lifecycle.State#RESUMED state, while all other fragments are capped at Lifecycle.State#STARTED. If <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a></code> is passed, all fragments are in the Lifecycle.State#RESUMED state and there will be callbacks to <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html#setUserVisibleHint(boolean)">Fragment#setUserVisibleHint(boolean)</a></code>.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2">Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>fm:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a></code></td>
<td width="100%">
<p>fragment manager that will interact with this adapter</p>
</td>
</tr>
<tr>
<td><code>behavior:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<p>determines if only current fragments are in a resumed stateValue is <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT()">BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT</a></code></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public functions</h2>
<div><a name="destroyItem(android.view.ViewGroup, int, java.lang.Object)"></a><a name="destroyItem-android.view.ViewGroup-int-java.lang.Object-"></a>
<h3 class="api-name" id="destroyItem(android.view.ViewGroup,int,java.lang.Object)">destroyItem</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#destroyItem(android.view.ViewGroup,int,java.lang.Object)">destroyItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</div>
<div><a name="finishUpdate-android.view.ViewGroup-"></a>
<h3 class="api-name" id="finishUpdate(android.view.ViewGroup)">finishUpdate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#finishUpdate(android.view.ViewGroup)">finishUpdate</a>(container:&nbsp;ViewGroup):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</div>
<div><a name="getItem-int-"></a>
<h3 class="api-name" id="getItem(int)">getItem</h3>
<pre class="api-signature no-pretty-print">abstract&nbsp;fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#getItem(int)">getItem</a>(position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>):&nbsp;<a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></pre>
<p>Return the Fragment associated with a specified position.</p>
</div>
<div><a name="instantiateItem(android.view.ViewGroup, int)"></a><a name="instantiateItem-android.view.ViewGroup-int-"></a>
<h3 class="api-name" id="instantiateItem(android.view.ViewGroup,int)">instantiateItem</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#instantiateItem(android.view.ViewGroup,int)">instantiateItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&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/-any/index.html">Any</a></pre>
</div>
<div><a name="isViewFromObject(android.view.View, java.lang.Object)"></a><a name="isViewFromObject-android.view.View-java.lang.Object-"></a>
<h3 class="api-name" id="isViewFromObject(android.view.View,java.lang.Object)">isViewFromObject</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#isViewFromObject(android.view.View,java.lang.Object)">isViewFromObject</a>(view:&nbsp;View,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></pre>
</div>
<div><a name="restoreState(android.os.Parcelable, java.lang.ClassLoader)"></a><a name="restoreState-android.os.Parcelable-java.lang.ClassLoader-"></a>
<h3 class="api-name" id="restoreState(android.os.Parcelable,java.lang.ClassLoader)">restoreState</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#restoreState(android.os.Parcelable,java.lang.ClassLoader)">restoreState</a>(state:&nbsp;Parcelable?,&nbsp;loader:&nbsp;<a href="https://developer.android.com/reference/java/lang/ClassLoader.html">ClassLoader</a>?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</div>
<div><a name="saveState--"></a>
<h3 class="api-name" id="saveState()">saveState</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#saveState()">saveState</a>():&nbsp;Parcelable?</pre>
</div>
<div><a name="setPrimaryItem(android.view.ViewGroup, int, java.lang.Object)"></a><a name="setPrimaryItem-android.view.ViewGroup-int-java.lang.Object-"></a>
<h3 class="api-name" id="setPrimaryItem(android.view.ViewGroup,int,java.lang.Object)">setPrimaryItem</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#setPrimaryItem(android.view.ViewGroup,int,java.lang.Object)">setPrimaryItem</a>(container:&nbsp;ViewGroup,&nbsp;position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>,&nbsp;object:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</div>
<div><a name="startUpdate-android.view.ViewGroup-"></a>
<h3 class="api-name" id="startUpdate(android.view.ViewGroup)">startUpdate</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html#startUpdate(android.view.ViewGroup)">startUpdate</a>(container:&nbsp;ViewGroup):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
</div>
</body>
</html>