Added in API level 1
Deprecated in API level 13

TabActivity


open class TabActivity : ActivityGroup
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.view.ContextThemeWrapper
   ↳ android.app.Activity
   ↳ android.app.ActivityGroup
   ↳ android.app.TabActivity

For apps developing against android.os.Build.VERSION_CODES#HONEYCOMB or later, tabs are typically presented in the UI using the new ActionBar.newTab() and related APIs for placing tabs within their action bar area.

Summary

Inherited constants
Public constructors

Public methods
open TabHost!

Returns the TabHost the activity is using to host its tabs.

open TabWidget!

Returns the TabWidget the activity is using to draw the actual tabs.

open Unit

Updates the screen state (current list and other views) when the content changes.

open Unit

Sets the default tab that is the first tab highlighted.

open Unit

Sets the default tab that is the first tab highlighted.

Protected methods
open Unit
onChildTitleChanged(childActivity: Activity!, title: CharSequence!)

open Unit
onPostCreate(icicle: Bundle?)

Called when activity start-up is complete (after onStart and #onRestoreInstanceState have been called).

open Unit

This method is called after onStart when the activity is being re-initialized from a previously saved state, given here in savedInstanceState.

open Unit

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in #onCreate or #onRestoreInstanceState (the Bundle populated by this method will be passed to both).

Inherited functions
Inherited properties

Public constructors

TabActivity

Added in API level 1
TabActivity()

Public methods

getTabHost

Added in API level 1
open fun getTabHost(): TabHost!

Deprecated: Deprecated in Java.

Returns the TabHost the activity is using to host its tabs.

Return
TabHost! the TabHost the activity is using to host its tabs.

getTabWidget

Added in API level 1
open fun getTabWidget(): TabWidget!

Deprecated: Deprecated in Java.

Returns the TabWidget the activity is using to draw the actual tabs.

Return
TabWidget! the TabWidget the activity is using to draw the actual tabs.

onContentChanged

Added in API level 1
open fun onContentChanged(): Unit

Deprecated: Deprecated in Java.

Updates the screen state (current list and other views) when the content changes.

setDefaultTab

Added in API level 1
open fun setDefaultTab(index: Int): Unit

Deprecated: Deprecated in Java.

Sets the default tab that is the first tab highlighted.

Parameters
index Int: the index of the default tab

setDefaultTab

Added in API level 1
open fun setDefaultTab(tag: String!): Unit

Deprecated: Deprecated in Java.

Sets the default tab that is the first tab highlighted.

Parameters
tag String!: the name of the default tab

Protected methods

onChildTitleChanged

Added in API level 1
protected open fun onChildTitleChanged(
    childActivity: Activity!,
    title: CharSequence!
): Unit

Deprecated: Deprecated in Java.

onPostCreate

Added in API level 1
protected open fun onPostCreate(icicle: Bundle?): Unit

Deprecated: Deprecated in Java.

Called when activity start-up is complete (after onStart and #onRestoreInstanceState have been called). Applications will generally not implement this method; it is intended for system classes to do final initialization after application code has run.

Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

.
If you override this method you must call through to the superclass implementation.
Parameters
savedInstanceState If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in #onSaveInstanceState. Note: Otherwise it is null.

onRestoreInstanceState

Added in API level 1
protected open fun onRestoreInstanceState(state: Bundle): Unit

Deprecated: Deprecated in Java.

This method is called after onStart when the activity is being re-initialized from a previously saved state, given here in savedInstanceState. Most implementations will simply use #onCreate to restore their state, but it is sometimes convenient to do it here after all of the initialization has been done or to allow subclasses to decide whether to use your default implementation. The default implementation of this method performs a restore of any view state that had previously been frozen by #onSaveInstanceState.

This method is called between onStart and #onPostCreate. This method is called only when recreating an activity; the method isn't invoked if onStart is called for any other reason.

Parameters
savedInstanceState the data most recently supplied in #onSaveInstanceState.
This value cannot be null.

onSaveInstanceState

Added in API level 1
protected open fun onSaveInstanceState(outState: Bundle): Unit

Deprecated: Deprecated in Java.

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in #onCreate or #onRestoreInstanceState (the Bundle populated by this method will be passed to both).

This method is called before an activity may be killed so that when it comes back some time in the future it can restore its state. For example, if activity B is launched in front of activity A, and at some point activity A is killed to reclaim resources, activity A will have a chance to save the current state of its user interface via this method so that when the user returns to activity A, the state of the user interface can be restored via #onCreate or #onRestoreInstanceState.

Do not confuse this method with activity lifecycle callbacks such as onPause, which is always called when the user no longer actively interacts with an activity, or onStop which is called when activity becomes invisible. One example of when onPause and onStop is called and not this method is when a user navigates back from activity B to activity A: there is no need to call #onSaveInstanceState on B because that particular instance will never be restored, so the system avoids calling it. An example when onPause is called and not #onSaveInstanceState is when activity B is launched in front of activity A: the system may avoid calling #onSaveInstanceState on activity A if it isn't killed during the lifetime of B since the state of the user interface of A will stay intact.

The default implementation takes care of most of the UI per-instance state for you by calling android.view.View#onSaveInstanceState() on each view in the hierarchy that has an id, and by saving the id of the currently focused view (all of which is restored by the default implementation of #onRestoreInstanceState). If you override this method to save additional information not captured by each individual view, you will likely want to call through to the default implementation, otherwise be prepared to save all of the state of each view yourself.

If called, this method will occur after onStop for applications targeting platforms starting with android.os.Build.VERSION_CODES#P. For applications targeting earlier platform versions this method will occur before onStop and there are no guarantees about whether it will occur before or after onPause.

Parameters
outState Bundle: Bundle in which to place your saved state.
This value cannot be null.