blob: 48fadc9440bc06da34719e0b1b67814881ed5e4f [file] [log] [blame]
<html devsite="true">
<head>
<title>FragmentTabHost</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>FragmentTabHost</h1>
{% setvar page_path %}androidx/fragment/app/FragmentTabHost.html{% endsetvar %}
{% setvar can_switch %}1{% endsetvar %}
{% include "reference/_kotlin_switcher2.md" %}
<p>
<pre>class FragmentTabHost</pre>
</p>
<hr>
<aside class="caution"><strong>This class is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
<p>Special TabHost that allows the use of <code><a href="/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a></code> objects for its tab content. When placing this in a view hierarchy, after inflating the hierarchy you must call <code><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#setup(android.content.Context,androidx.fragment.app.FragmentManager,int)">setup</a></code> to complete the initialization of the tab host.</p>
<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><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#FragmentTabHost(android.content.Context)">FragmentTabHost</a></del></span>(context:&nbsp;Context)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</p>
</td>
</tr>
<tr>
<td>
<div><code><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#FragmentTabHost(android.content.Context,android.util.AttributeSet)">FragmentTabHost</a></del></span>(context:&nbsp;Context,&nbsp;attrs:&nbsp;AttributeSet?)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</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><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#addTab(android.widget.TabHost.TabSpec,java.lang.Class&lt;?&gt;,android.os.Bundle)">addTab</a></del></span>(tabSpec:&nbsp;TabSpec,&nbsp;clss:&nbsp;<a href="https://developer.android.com/reference/java/lang/Class.html">Class</a>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>&gt;,&nbsp;args:&nbsp;Bundle?)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</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/FragmentTabHost.html#onTabChanged(java.lang.String)">onTabChanged</a></del></span>(tabId:&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 <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</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/FragmentTabHost.html#setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener)">setOnTabChangedListener</a></del></span>(l:&nbsp;OnTabChangeListener?)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</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/FragmentTabHost.html#setup()">setup</a></del></span>()</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</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/FragmentTabHost.html#setup(android.content.Context,androidx.fragment.app.FragmentManager)">setup</a></del></span>(context:&nbsp;Context,&nbsp;manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>)</code></div>
<p><strong>This function is deprecated.</strong>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</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/FragmentTabHost.html#setup(android.content.Context,androidx.fragment.app.FragmentManager,int)">setup</a></del></span>(context:&nbsp;Context,&nbsp;manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;containerId:&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 <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public constructors</h2>
<div><a name="FragmentTabHost-android.content.Context-"></a>
<h3 class="api-name" id="FragmentTabHost(android.content.Context)">FragmentTabHost</h3>
<pre class="api-signature no-pretty-print"><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#FragmentTabHost(android.content.Context)">FragmentTabHost</a></del></span>(context:&nbsp;Context)</pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<div><a name="FragmentTabHost(android.content.Context, android.util.AttributeSet)"></a><a name="FragmentTabHost-android.content.Context-android.util.AttributeSet-"></a>
<h3 class="api-name" id="FragmentTabHost(android.content.Context,android.util.AttributeSet)">FragmentTabHost</h3>
<pre class="api-signature no-pretty-print"><span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#FragmentTabHost(android.content.Context,android.util.AttributeSet)">FragmentTabHost</a></del></span>(context:&nbsp;Context,&nbsp;attrs:&nbsp;AttributeSet?)</pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<h2>Public functions</h2>
<div><a name="addTab(android.widget.TabHost.TabSpec, java.lang.Class&lt;?&gt;, android.os.Bundle)"></a><a name="addTab-android.widget.TabHost.TabSpec-java.lang.Class&lt;?&gt;-android.os.Bundle-"></a>
<h3 class="api-name" id="addTab(android.widget.TabHost.TabSpec,java.lang.Class&lt;?&gt;,android.os.Bundle)">addTab</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#addTab(android.widget.TabHost.TabSpec,java.lang.Class&lt;?&gt;,android.os.Bundle)">addTab</a></del></span>(tabSpec:&nbsp;TabSpec,&nbsp;clss:&nbsp;<a href="https://developer.android.com/reference/java/lang/Class.html">Class</a>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>&gt;,&nbsp;args:&nbsp;Bundle?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<div><a name="onTabChanged-java.lang.String-"></a>
<h3 class="api-name" id="onTabChanged(java.lang.String)">onTabChanged</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#onTabChanged(java.lang.String)">onTabChanged</a></del></span>(tabId:&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>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<div><a name="setOnTabChangedListener-android.widget.TabHost.OnTabChangeListener-"></a>
<h3 class="api-name" id="setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener)">setOnTabChangedListener</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener)">setOnTabChangedListener</a></del></span>(l:&nbsp;OnTabChangeListener?):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<div><a name="setup--"></a>
<h3 class="api-name" id="setup()">setup</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#setup()">setup</a></del></span>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
</div>
<div><a name="setup(android.content.Context, androidx.fragment.app.FragmentManager)"></a><a name="setup-android.content.Context-androidx.fragment.app.FragmentManager-"></a>
<h3 class="api-name" id="setup(android.content.Context,androidx.fragment.app.FragmentManager)">setup</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#setup(android.content.Context,androidx.fragment.app.FragmentManager)">setup</a></del></span>(context:&nbsp;Context,&nbsp;manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
<p>Set up the FragmentTabHost to use the given FragmentManager</p>
</div>
<div><a name="setup(android.content.Context, androidx.fragment.app.FragmentManager, int)"></a><a name="setup-android.content.Context-androidx.fragment.app.FragmentManager-int-"></a>
<h3 class="api-name" id="setup(android.content.Context,androidx.fragment.app.FragmentManager,int)">setup</h3>
<pre class="api-signature no-pretty-print">fun&nbsp;<span><del><a href="/reference/kotlin/androidx/fragment/app/FragmentTabHost.html#setup(android.content.Context,androidx.fragment.app.FragmentManager,int)">setup</a></del></span>(context:&nbsp;Context,&nbsp;manager:&nbsp;<a href="/reference/kotlin/androidx/fragment/app/FragmentManager.html">FragmentManager</a>,&nbsp;containerId:&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>
<aside class="caution"><strong>This function is deprecated.</strong><br>
<p>Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">TabLayout and ViewPager</a> instead.</p>
</aside>
<p>Set up the FragmentTabHost to use the given FragmentManager</p>
</div>
</body>
</html>