blob: 0029157da0a64ed1ba91a8ff832ad8a5a1619b1a [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentPagerAdapter</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>FragmentPagerAdapter</h1>
{% setvar page_path %}androidx/fragment/app/FragmentPagerAdapter.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>abstract class FragmentPagerAdapter</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 represents each page as a <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code> that is persistently kept in the fragment manager as long as the user can return to the page. </p>
<p>This version of the pager is best for use when there are a handful of typically more static fragments to be paged through, such as a set of tabs. The fragment of each page the user visits will be kept in memory, though its view hierarchy may be destroyed when not visible. This can result in using a significant amount of memory since fragment instances can hold on to an arbitrary amount of state. For larger sets of pages, consider <code><a href="/reference/kotlin/androidx/fragment/app/FragmentStatePagerAdapter.html">FragmentStatePagerAdapter</a></code>. </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/FragmentPagerAdapter.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/FragmentPagerSupport.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager)">FragmentPagerAdapter</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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</a></code> with <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</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/FragmentPagerAdapter.html">FragmentPagerAdapter</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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/-long/index.html">Long</a></code></td>
<td width="100%">
<div><code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html#getItemId(int)">getItemId</a>(position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Return a unique identifier for the item at the given 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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</a></code></td>
<td width="100%">
<p>#FragmentPagerAdapter(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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</a></code></td>
<td width="100%">
<p>#FragmentPagerAdapter(FragmentManager, int)</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Public constructors</h2>
<div><a name="FragmentPagerAdapter-androidx.fragment.app.FragmentManager-"></a>
<h3 class="api-name" id="FragmentPagerAdapter(androidx.fragment.app.FragmentManager)">FragmentPagerAdapter</h3>
<pre class="api-signature no-pretty-print"><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager)">FragmentPagerAdapter</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/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</a></code> with <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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/FragmentPagerAdapter.html">FragmentPagerAdapter</a></code> that sets the fragment manager for the adapter. This is the equivalent of calling <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</a></code> and passing in <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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="FragmentPagerAdapter(androidx.fragment.app.FragmentManager, int)"></a><a name="FragmentPagerAdapter-androidx.fragment.app.FragmentManager-int-"></a>
<h3 class="api-name" id="FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</h3>
<pre class="api-signature no-pretty-print"><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html#FragmentPagerAdapter(androidx.fragment.app.FragmentManager,int)">FragmentPagerAdapter</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/FragmentPagerAdapter.html">FragmentPagerAdapter</a></code>. If <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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. All other fragments are capped at Lifecycle.State#STARTED. If <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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/FragmentPagerAdapter.html#BEHAVIOR_SET_USER_VISIBLE_HINT()">BEHAVIOR_SET_USER_VISIBLE_HINT</a></code>, or <code><a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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="getItemId-int-"></a>
<h3 class="api-name" id="getItemId(int)">getItemId</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentPagerAdapter.html#getItemId(int)">getItemId</a>(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/-long/index.html">Long</a></pre>
<p>Return a unique identifier for the item at the given position. </p>
<p>The default implementation returns the given position. Subclasses should override this method if the positions of items can change.</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/-long/index.html">Long</a></code></td>
<td width="100%">
<p>Unique identifier for the item at position</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>position:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td width="100%">
<p>Position within this adapter</p>
</td>
</tr>
</tbody>
</table>
</div>
</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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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/FragmentPagerAdapter.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>