# PlaybackSupportFragment

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/app/PlaybackSupportFragment.java+class:androidx.leanback.app.PlaybackSupportFragment) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
public class PlaybackSupportFragment extends Fragment
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.fragment.app.Fragment](https://developer.android.com/reference/androidx/fragment/app/Fragment) ||
|   | ↳ | [androidx.leanback.app.PlaybackSupportFragment](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment) |

Known direct subclasses [VideoSupportFragment](https://developer.android.com/reference/androidx/leanback/app/VideoSupportFragment)

|---|---|
| `https://developer.android.com/reference/androidx/leanback/app/VideoSupportFragment` | Subclass of `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment` that is responsible for providing a `https://developer.android.com/reference/android/view/SurfaceView.html` and rendering video. |

*** ** * ** ***

A fragment for displaying playback controls and related content.

A PlaybackSupportFragment renders the elements of its `https://developer.android.com/reference/androidx/leanback/widget/ObjectAdapter` as a set of rows in a vertical list. The Adapter's `https://developer.android.com/reference/androidx/leanback/widget/PresenterSelector` must maintain subclasses of `https://developer.android.com/reference/androidx/leanback/widget/RowPresenter`.

A playback row is a row rendered by `https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter`. App can call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)` to set playback row for the first element of adapter. App can call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter)` to set presenter for it. `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)` and `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter)` are optional, app can pass playback row and PlaybackRowPresenter in the adapter using `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setAdapter(androidx.leanback.widget.ObjectAdapter)`.

Hiding and showing controls: the controls are initially visible and automatically show/hide when play/pause or user interacts with fragment.

- App may manually call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#showControlsOverlay(boolean)` or `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#hideControlsOverlay(boolean)` to show or hide the controls.
- The controls are visible by default upon onViewCreated(). To make it initially invisible, call hideControlsOverlay(false) in overridden onViewCreated().
- Upon play or pause, PlaybackControlGlue or PlaybackTransportControlGlue will fade-in the controls and automatically fade out after a delay customized by . To disable the fade in and fade out behavior: call `https://developer.android.com/reference/androidx/leanback/media/PlaybackBaseControlGlue` with false.
- Upon user interaction event, fragment will fade-in the controls and automatically fade out after a delay customized by . To disable the fade in and fade out behavior, call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setShowOrHideControlsOverlayOnUserInteraction(boolean)` with false.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#BG_DARK() = 1` A dark translucent background. |
| `static final int` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#BG_LIGHT() = 2` A light translucent background. |
| `static final int` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#BG_NONE() = 0` No background. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#PlaybackSupportFragment()()` |

| ### Public methods |
|---|---|
| `void` | `[fadeOut](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#fadeOut())()` **This method is deprecated.** Call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#hideControlsOverlay(boolean)` <br /> |
| `https://developer.android.com/reference/androidx/leanback/widget/ObjectAdapter` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#getAdapter()()` |
| `int` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#getBackgroundType()()` Returns the background type. |
| `https://developer.android.com/reference/androidx/leanback/app/ProgressBarManager` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#getProgressBarManager()()` Returns the ProgressBarManager that will show or hide progress bar in `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onBufferingStateChanged(boolean)`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#hideControlsOverlay(boolean)(boolean runAnimation)` Hide controls overlay. |
| `boolean` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isControlsOverlayAutoHideEnabled()()` Returns true if controls will be auto hidden after a delay when fragment is resumed. |
| `boolean` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isControlsOverlayVisible()()` Returns true if controls overlay is visible, false otherwise. |
| `boolean` | `[isFadingEnabled](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isFadingEnabled())()` **This method is deprecated.** Uses `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isControlsOverlayAutoHideEnabled()` <br /> |
| `boolean` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isShowOrHideControlsOverlayOnUserInteraction()()` Returns true if showing and auto-hiding controls when user interacts; false otherwise. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#notifyPlaybackRowChanged()()` Updates the ui when the row data changes. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onCreate(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` Called to do initial creation of a fragment. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/ViewGroup.html container, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` Called to have the fragment instantiate its user interface view. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onDestroy()()` Called when the fragment is no longer in use. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onDestroyView()()` Called when the view previously created by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has been detached from the fragment. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onPause()()` Called when the Fragment is no longer resumed. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onResume()()` Called when the fragment is visible to the user and actively running. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onStart()()` Called when the Fragment is visible to the user. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onStop()()` Called when the Fragment is no longer started. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onViewCreated(android.view.View,android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` Called immediately after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has returned, but before any saved state has been restored in to the view. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setAdapter(androidx.leanback.widget.ObjectAdapter)(https://developer.android.com/reference/androidx/leanback/widget/ObjectAdapter adapter)` Sets the list of rows for the fragment. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setBackgroundType(int)(int type)` Sets the background type. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setControlsOverlayAutoHideEnabled(boolean)(boolean enabled)` Enables or disables auto hiding controls overlay after a short delay fragment is resumed. |
| `void` | `[setFadingEnabled](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setFadingEnabled(boolean))(boolean enabled)` **This method is deprecated.** Uses `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setControlsOverlayAutoHideEnabled(boolean)` <br /> |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback)(https://developer.android.com/reference/androidx/leanback/media/PlaybackGlueHost.HostCallback hostCallback)` Sets the `https://developer.android.com/reference/androidx/leanback/media/PlaybackGlueHost.HostCallback`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener)(https://developer.android.com/reference/androidx/leanback/widget/BaseOnItemViewClickedListener listener)` This listener is called every time there is a click in `https://developer.android.com/reference/androidx/leanback/app/RowsSupportFragment`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener)(https://developer.android.com/reference/androidx/leanback/widget/BaseOnItemViewSelectedListener listener)` This listener is called every time there is a selection in `https://developer.android.com/reference/androidx/leanback/app/RowsSupportFragment`. |
| `final void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setOnKeyInterceptListener(android.view.View.OnKeyListener)(https://developer.android.com/reference/android/view/View.OnKeyListener.html handler)` Sets the input event handler. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setOnPlaybackItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener)( https://developer.android.com/reference/androidx/leanback/widget/BaseOnItemViewClickedListener listener )` Sets the `https://developer.android.com/reference/androidx/leanback/widget/BaseOnItemViewClickedListener` that would be invoked for clicks only on `https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter.ViewHolder`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)(https://developer.android.com/reference/androidx/leanback/widget/Row row)` Sets the playback row for the playback controls. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter)(https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter presenter)` Sets the presenter for rendering the playback row set by `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client)(https://developer.android.com/reference/androidx/leanback/widget/PlaybackSeekUi.Client client)` Interface to be implemented by UI widget to support PlaybackSeekUi. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setSelectedPosition(int)(int position)` Sets the selected row position with smooth animation. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setSelectedPosition(int,boolean)(int position, boolean smooth)` Sets the selected row position. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setShowOrHideControlsOverlayOnUserInteraction(boolean)( boolean showOrHideControlsOverlayOnUserInteraction )` Enables or disables showing and auto-hiding controls when user interacts. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#showControlsOverlay(boolean)(boolean runAnimation)` Show controls overlay. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#tickle()()` Tickles the playback controls. |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onBufferingStateChanged(boolean)(boolean start)` Called when media has start or stop buffering. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onError(int,java.lang.CharSequence)(int errorCode, https://developer.android.com/reference/java/lang/CharSequence.html errorMessage)` Called when media has error. |
| `void` | `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onVideoSizeChanged(int,int)(int videoWidth, int videoHeight)` Called when size of the video changes. |

### Inherited methods

From [androidx.activity.result.ActivityResultCaller](https://developer.android.com/reference/androidx/activity/result/ActivityResultCaller) `abstract https://developer.android.com/reference/androidx/activity/result/ActivityResultLauncher<I>` `<I, O> https://developer.android.com/reference/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultCallback<O>)(
https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<I, O> contract,
https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback<O> callback
)`

Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`.
From [android.content.ComponentCallbacks](https://developer.android.com/reference/android/content/ComponentCallbacks.html) `abstract void` `https://developer.android.com/reference/android/content/ComponentCallbacks.html#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration.html p)` `abstract void` `https://developer.android.com/reference/android/content/ComponentCallbacks.html#onLowMemory()()`

**This method is deprecated.**
From [androidx.activity.contextaware.ContextAware](https://developer.android.com/reference/androidx/activity/contextaware/ContextAware) `abstract void` `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener)`

Add a new `https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener` for receiving a callback for when this class is associated with a `https://developer.android.com/reference/android/content/Context.html`.
`abstract https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#peekAvailableContext()()`

Get the `https://developer.android.com/reference/android/content/Context.html` if it is currently available.
`abstract void` `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener)`

Remove a `https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener` previously added via `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)`.
From [androidx.fragment.app.Fragment](https://developer.android.com/reference/androidx/fragment/app/Fragment) `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener
)`

Add a new `https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener` for receiving a callback for when this class is associated with a `https://developer.android.com/reference/android/content/Context.html`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html prefix,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/io/FileDescriptor.html fd,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/PrintWriter.html writer,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] args
)`

Print the Fragments's state into the given stream.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html o)`

Subclasses can not override equals().
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getActivity()()`

Return the `https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` this fragment is currently associated with.
`boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getAllowEnterTransitionOverlap()()`

Returns whether the the exit transition and enter transition overlap or not.
`boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getAllowReturnTransitionOverlap()()`

Returns whether the the return transition and reenter transition overlap or not.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getArguments()()`

Return the arguments supplied when the fragment was instantiated, if any.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getChildFragmentManager()()`

Return a private FragmentManager for placing and managing Fragments inside of this Fragment.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getContext()()`

Return the `https://developer.android.com/reference/android/content/Context.html` this fragment is currently associated with.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` `@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#getDefaultViewModelCreationExtras()()`

The default `https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` to pass into `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory#create(kotlin.reflect.KClass,androidx.lifecycle.viewmodel.CreationExtras)` when no overriding `https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` are provided.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getDefaultViewModelProviderFactory()()`

The default `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` to use when no custom `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` is provided to the `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getEnterTransition()()`

Returns the Transition that will be used to move Views into the initial scene.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getExitTransition()()`

Returns the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `[getFragmentManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#getFragmentManager())()`

**This method is deprecated.**

This has been removed in favor of `getParentFragmentManager()` which throws an `https://developer.android.com/reference/java/lang/IllegalStateException.html` if the FragmentManager is null.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getHost()()`

Return the host object of this fragment.
`final int` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getId()()`

Return the identifier this fragment is known by.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getLayoutInflater()()`

Returns the cached LayoutInflater used to inflate Views of this Fragment.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/Lifecycle` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getLifecycle()()`

The `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` of this owner.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/loader/app/LoaderManager` `[getLoaderManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#getLoaderManager())()`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/loader/app/LoaderManager#getInstance(T)`.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getParentFragment()()`

Returns the parent Fragment containing this Fragment.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getParentFragmentManager()()`

Return the FragmentManager for interacting with fragments associated with this fragment's activity.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getReenterTransition()()`

Returns the Transition that will be used to move Views in to the scene when returning due to popping a back stack.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Resources.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getResources()()`

Return `requireActivity().getResources()`.
`final boolean` `[getRetainInstance](https://developer.android.com/reference/androidx/fragment/app/Fragment#getRetainInstance())()`

**This method is deprecated.**

Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment.

<br />

`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getReturnTransition()()`

Returns the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/savedstate/SavedStateRegistry` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSavedStateRegistry()()`

The `https://developer.android.com/reference/androidx/savedstate/SavedStateRegistry` owned by this `https://developer.android.com/reference/androidx/savedstate/SavedStateRegistryOwner`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSharedElementEnterTransition()()`

Returns the Transition that will be used for shared elements transferred into the content Scene.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getSharedElementReturnTransition()()`

Return the Transition that will be used for shared elements transferred back during a pop of the back stack.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getString(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId)`

Return a localized string from the application's package's default string table.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getString(int,java.lang.Object...)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html Object[] formatArgs)`

Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in `https://developer.android.com/reference/java/util/Formatter.html` and `https://developer.android.com/reference/java/lang/String.html#format(java.lang.String, java.lang.Object...)`.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getTag()()`

Get the tag name of the fragment, if specified.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `[getTargetFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#getTargetFragment())()`

**This method is deprecated.**

Instead of using a target fragment to pass results, use `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#setFragmentResult(java.lang.String,android.os.Bundle)` to deliver results to `https://developer.android.com/reference/androidx/fragment/app/FragmentResultListener` instances registered by other fragments via `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)`.

<br />

`final int` `[getTargetRequestCode](https://developer.android.com/reference/androidx/fragment/app/Fragment#getTargetRequestCode())()`

**This method is deprecated.**

When using the target fragment replacement of `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)` and `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#setFragmentResult(java.lang.String,android.os.Bundle)`, consider using `https://developer.android.com/reference/androidx/fragment/app/Fragment#setArguments(android.os.Bundle)` to pass a `requestKey` if you need to support dynamic request keys.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getText(int)(@https://developer.android.com/reference/androidx/annotation/StringRes int resId)`

Return a localized, styled CharSequence from the application's package's default string table.
`boolean` `[getUserVisibleHint](https://developer.android.com/reference/androidx/fragment/app/Fragment#getUserVisibleHint())()`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/fragment/app/FragmentTransaction#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)` instead.

<br />

`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getView()()`

Get the root view for the fragment's layout (the one returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`), if provided.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewLifecycleOwner()()`

Get a `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` that represents the `https://developer.android.com/reference/androidx/fragment/app/Fragment#getView()` lifecycle.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/LiveData<https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner>` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewLifecycleOwnerLiveData()()`

Retrieve a `https://developer.android.com/reference/androidx/lifecycle/LiveData` which allows you to observe the `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewLifecycleOwner()`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/lifecycle/ViewModelStore` `https://developer.android.com/reference/androidx/fragment/app/Fragment#getViewModelStore()()`

Returns the `https://developer.android.com/reference/androidx/lifecycle/ViewModelStore` associated with this Fragment
`final int` `https://developer.android.com/reference/androidx/fragment/app/Fragment#hashCode()()`

Subclasses can not override hashCode().
`static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `[instantiate](https://developer.android.com/reference/androidx/fragment/app/Fragment#instantiate(android.content.Context,java.lang.String))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html fname)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#getFragmentFactory()` and `https://developer.android.com/reference/androidx/fragment/app/FragmentFactory#instantiate(java.lang.ClassLoader,java.lang.String)`

<br />

`static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `[instantiate](https://developer.android.com/reference/androidx/fragment/app/Fragment#instantiate(android.content.Context,java.lang.String,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html fname,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html args
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#getFragmentFactory()` and `https://developer.android.com/reference/androidx/fragment/app/FragmentFactory#instantiate(java.lang.ClassLoader,java.lang.String)`, manually calling `https://developer.android.com/reference/androidx/fragment/app/Fragment#setArguments(android.os.Bundle)` on the returned Fragment.

<br />

`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isAdded()()`

Return true if the fragment is currently added to its activity.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isDetached()()`

Return true if the fragment has been explicitly detached from the UI.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isHidden()()`

Return true if the fragment has been hidden.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isInLayout()()`

Return true if the layout is included as part of an activity view hierarchy via the tag.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isRemoving()()`

Return true if this fragment is currently being removed from its activity.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isResumed()()`

Return true if the fragment is in the resumed state.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isStateSaved()()`

Returns true if this fragment is added and its state has already been saved by its host.
`final boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#isVisible()()`

Return true if the fragment is currently visible to the user.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onActivityCreated](https://developer.android.com/reference/androidx/fragment/app/Fragment#onActivityCreated(android.os.Bundle))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**

use `https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)` for code touching the view created by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` and `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` for other initialization.

<br />

`void` `[onActivityResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#onActivityResult(int,int,android.content.Intent))(int requestCode, int resultCode, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html data)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onAttach](https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.app.Activity))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html activity)`

**This method is deprecated.**

See `https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.content.Context)`.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)`

Called when a fragment is first attached to its context.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onAttachFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttachFragment(androidx.fragment.app.Fragment))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment childFragment)`

**This method is deprecated.**

The responsibility for listening for fragments being attached has been moved to FragmentManager.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onConfigurationChanged(android.content.res.Configuration)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Configuration.html newConfig)` `boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onContextItemSelected(android.view.MenuItem)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/MenuItem.html item)`

This hook is called whenever an item in a context menu is selected.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/animation/Animation.html` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateAnimation(int,boolean,int)(int transit, boolean enter, int nextAnim)`

Called when a fragment loads an animation.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateAnimator(int,boolean,int)(int transit, boolean enter, int nextAnim)`

Called when a fragment loads an animator.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateContextMenu(android.view.ContextMenu,android.view.View,android.view.ContextMenu.ContextMenuInfo)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ContextMenu.html menu,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html v,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html menuInfo
)`

Called when a context menu for the `view` is about to be shown.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onCreateOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/MenuInflater.html inflater)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/androidx/activity/ComponentActivity#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onDestroyOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroyOptionsMenu())()`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onDetach()()`

Called when the fragment is no longer attached to its activity.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onGetLayoutInflater(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

Returns the LayoutInflater used to inflate Views of this Fragment.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onHiddenChanged(boolean)(boolean hidden)`

Called when the hidden state (as returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#isHidden()` of the fragment or another fragment in its hierarchy has changed.
`void` `@https://developer.android.com/reference/androidx/annotation/UiThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
[onInflate](https://developer.android.com/reference/androidx/fragment/app/Fragment#onInflate(android.app.Activity,android.util.AttributeSet,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Activity.html activity,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/util/AttributeSet.html attrs,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState
)`

**This method is deprecated.**

See `https://developer.android.com/reference/androidx/fragment/app/Fragment#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)`.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/UiThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onInflate(android.content.Context,android.util.AttributeSet,android.os.Bundle)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/util/AttributeSet.html attrs,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState
)`

Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an activity.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onLowMemory()()`

**This method is deprecated.**
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onMultiWindowModeChanged(boolean)(boolean isInMultiWindowMode)`

Called when the Fragment's activity changes from fullscreen mode to multi-window mode and visa-versa.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onOptionsItemSelected](https://developer.android.com/reference/androidx/fragment/app/Fragment#onOptionsItemSelected(android.view.MenuItem))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/MenuItem.html item)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onOptionsMenuClosed](https://developer.android.com/reference/androidx/fragment/app/Fragment#onOptionsMenuClosed(android.view.Menu))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#onPictureInPictureModeChanged(boolean)(boolean isInPictureInPictureMode)`

Called by the system when the activity changes to and from picture-in-picture mode.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
[onPrepareOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#onPrepareOptionsMenu(android.view.Menu))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**

`https://developer.android.com/reference/androidx/activity/ComponentActivity` now implements `https://developer.android.com/reference/androidx/core/view/MenuHost`, an interface that allows any component, including your activity itself, to add menu items by calling `https://developer.android.com/reference/androidx/core/view/MenuHost#addMenuProvider(androidx.core.view.MenuProvider)` without forcing all components through this single method override.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onPrimaryNavigationFragmentChanged(boolean)(
boolean isPrimaryNavigationFragment
)`

Callback for when the primary navigation state of this Fragment has changed.
`void` `[onRequestPermissionsResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#onRequestPermissionsResult(int,java.lang.String[],int[]))(
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] permissions,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html int[] grantResults
)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/fragment/app/Fragment#onSaveInstanceState(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html outState)`

Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance if its process is restarted.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
@https://developer.android.com/reference/androidx/annotation/CallSuper
https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewStateRestored(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

Called when all saved state has been restored into the view hierarchy of the fragment.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#peekAvailableContext()()`

Get the `https://developer.android.com/reference/android/content/Context.html` if it is currently available.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition()()`

Postpone the entering Fragment transition until `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()` or `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#executePendingTransactions()` has been called.
`final void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition(long,java.util.concurrent.TimeUnit)(long duration, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/TimeUnit.html timeUnit)`

Postpone the entering Fragment transition for a given amount of time and then call `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()`.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultLauncher<I>` `@https://developer.android.com/reference/androidx/annotation/MainThread
<I, O> https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultCallback<O>)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<I, O> contract,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback<O> callback
)`


Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultLauncher<I>` `@https://developer.android.com/reference/androidx/annotation/MainThread
<I, O> https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract<I,O>,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback<O>)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<I, O> contract,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultRegistry registry,
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback<O> callback
)`

Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#registerForContextMenu(android.view.View)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view)`

Registers a context menu to be shown for the given view (multiple views can show the context menu).
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#removeOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener listener
)`

Remove a `https://developer.android.com/reference/androidx/activity/contextaware/OnContextAvailableListener` previously added via `https://developer.android.com/reference/androidx/activity/contextaware/ContextAware#addOnContextAvailableListener(androidx.activity.contextaware.OnContextAvailableListener)`.
`final void` `[requestPermissions](https://developer.android.com/reference/androidx/fragment/app/Fragment#requestPermissions(java.lang.String[],int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html String[] permissions, int requestCode)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireActivity()()`

Return the `https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` this fragment is currently associated with.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireArguments()()`

Return the arguments supplied when the fragment was instantiated.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireContext()()`

Return the `https://developer.android.com/reference/android/content/Context.html` this fragment is currently associated with.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/FragmentManager` `[requireFragmentManager](https://developer.android.com/reference/androidx/fragment/app/Fragment#requireFragmentManager())()`

**This method is deprecated.**

This has been renamed to `getParentFragmentManager()` to make it clear that you are accessing the FragmentManager that contains this Fragment and not the FragmentManager associated with child Fragments.

<br />

`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireHost()()`

Return the host object of this fragment.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/fragment/app/Fragment` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireParentFragment()()`

Returns the parent Fragment containing this Fragment.
`final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#requireView()()`

Get the root view for the fragment's layout (the one returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`).
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setAllowEnterTransitionOverlap(boolean)(boolean allow)`

Sets whether the the exit transition and enter transition overlap or not.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setAllowReturnTransitionOverlap(boolean)(boolean allow)`

Sets whether the the return transition and reenter transition overlap or not.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setArguments(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html args)`

Supply the construction arguments for this fragment.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setEnterSharedElementCallback(androidx.core.app.SharedElementCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/SharedElementCallback callback)`

When custom transitions are used with Fragments, the enter transition callback is called when this Fragment is attached or detached when not popping the back stack.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setEnterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used to move Views into the initial scene.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setExitSharedElementCallback(androidx.core.app.SharedElementCallback)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/SharedElementCallback callback)`

When custom transitions are used with Fragments, the exit transition callback is called when this Fragment is attached or detached when popping the back stack.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setExitTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used to move Views out of the scene when the fragment is removed, hidden, or detached when not popping the back stack.
`void` `[setHasOptionsMenu](https://developer.android.com/reference/androidx/fragment/app/Fragment#setHasOptionsMenu(boolean))(boolean hasMenu)`

**This method is deprecated.**

This method is no longer needed when using a `https://developer.android.com/reference/androidx/core/view/MenuProvider` to provide a `https://developer.android.com/reference/android/view/Menu.html` to your activity, which replaces `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateOptionsMenu(android.view.Menu,android.view.MenuInflater)` as the recommended way to provide a consistent, optionally `https://developer.android.com/reference/androidx/lifecycle/Lifecycle`-aware, and modular way to handle menu creation and item selection.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setInitialSavedState(androidx.fragment.app.Fragment.SavedState)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment.SavedState state)`

Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#saveFragmentInstanceState(androidx.fragment.app.Fragment)`.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setMenuVisibility(boolean)(boolean menuVisible)`

Set a hint for whether this fragment's menu should be visible.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setReenterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used to move Views in to the scene when returning due to popping a back stack.
`void` `[setRetainInstance](https://developer.android.com/reference/androidx/fragment/app/Fragment#setRetainInstance(boolean))(boolean retain)`

**This method is deprecated.**

Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setReturnTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used to move Views out of the scene when the Fragment is preparing to be removed, hidden, or detached because of popping the back stack.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setSharedElementEnterTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used for shared elements transferred into the content Scene.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#setSharedElementReturnTransition(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html transition)`

Sets the Transition that will be used for shared elements transferred back during a pop of the back stack.
`void` `[setTargetFragment](https://developer.android.com/reference/androidx/fragment/app/Fragment#setTargetFragment(androidx.fragment.app.Fragment,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/fragment/app/Fragment fragment, int requestCode)`

**This method is deprecated.**

Instead of using a target fragment to pass results, the fragment requesting a result should use `https://developer.android.com/reference/androidx/fragment/app/FragmentManager#setFragmentResultListener(java.lang.String,androidx.lifecycle.LifecycleOwner,androidx.fragment.app.FragmentResultListener)` to register a `https://developer.android.com/reference/androidx/fragment/app/FragmentResultListener` with a `
requestKey` using its `https://developer.android.com/reference/androidx/fragment/app/Fragment#getParentFragmentManager()`.

<br />

`void` `[setUserVisibleHint](https://developer.android.com/reference/androidx/fragment/app/Fragment#setUserVisibleHint(boolean))(boolean isVisibleToUser)`

**This method is deprecated.**

If you are manually calling this method, use `https://developer.android.com/reference/androidx/fragment/app/FragmentTransaction#setMaxLifecycle(androidx.fragment.app.Fragment,androidx.lifecycle.Lifecycle.State)` instead.

<br />

`boolean` `https://developer.android.com/reference/androidx/fragment/app/Fragment#shouldShowRequestPermissionRationale(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html permission)`

Gets whether you should show UI with rationale before requesting a permission.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivity(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)` from the fragment's containing Activity.
`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivity(android.content.Intent,android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options)`

Call `https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent, android.os.Bundle)` from the fragment's containing Activity.
`void` `[startActivityForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent, int requestCode)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `[startActivityForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startActivityForResult(android.content.Intent,int,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent,
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `[startIntentSenderForResult](https://developer.android.com/reference/androidx/fragment/app/Fragment#startIntentSenderForResult(android.content.IntentSender,int,android.content.Intent,int,int,int,android.os.Bundle))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/IntentSender.html intent,
int requestCode,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html fillInIntent,
int flagsMask,
int flagsValues,
int extraFlags,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method is deprecated.**

This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` and the prebuilt contracts for common intents available in `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts`, provides hooks for testing, and allow receiving results in separate, testable classes independent from your fragment.

<br />

`void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#startPostponedEnterTransition()()`

Begin postponed transitions after `https://developer.android.com/reference/androidx/fragment/app/Fragment#postponeEnterTransition()` was called.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/fragment/app/Fragment#toString()()` `void` `https://developer.android.com/reference/androidx/fragment/app/Fragment#unregisterForContextMenu(android.view.View)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view)`

Prevents a context menu to be shown for the given view.
From [androidx.lifecycle.HasDefaultViewModelProviderFactory](https://developer.android.com/reference/androidx/lifecycle/HasDefaultViewModelProviderFactory) `https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` `https://developer.android.com/reference/androidx/lifecycle/HasDefaultViewModelProviderFactory#getDefaultViewModelCreationExtras()()`

The default `https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` to pass into `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory#create(kotlin.reflect.KClass,androidx.lifecycle.viewmodel.CreationExtras)` when no overriding `https://developer.android.com/reference/androidx/lifecycle/viewmodel/CreationExtras` are provided.
`https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` `https://developer.android.com/reference/androidx/lifecycle/HasDefaultViewModelProviderFactory#getDefaultViewModelProviderFactory()()`

The default `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` to use when no custom `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory` is provided to the `https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider`.
From [androidx.lifecycle.LifecycleOwner](https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner) `abstract https://developer.android.com/reference/androidx/lifecycle/Lifecycle` `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner#getLifecycle()()`

The `https://developer.android.com/reference/androidx/lifecycle/Lifecycle` of this owner.
From [androidx.savedstate.SavedStateRegistryOwner](https://developer.android.com/reference/androidx/savedstate/SavedStateRegistryOwner) `abstract https://developer.android.com/reference/androidx/savedstate/SavedStateRegistry` `https://developer.android.com/reference/androidx/savedstate/SavedStateRegistryOwner#getSavedStateRegistry()()`

The `https://developer.android.com/reference/androidx/savedstate/SavedStateRegistry` owned by this `https://developer.android.com/reference/androidx/savedstate/SavedStateRegistryOwner`.
From [android.view.View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html) `abstract void` `https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)(
https://developer.android.com/reference/android/view/ContextMenu.html p,
https://developer.android.com/reference/android/view/View.html p1,
https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html p2
)` From [androidx.lifecycle.ViewModelStoreOwner](https://developer.android.com/reference/androidx/lifecycle/ViewModelStoreOwner) `abstract https://developer.android.com/reference/androidx/lifecycle/ViewModelStore` `https://developer.android.com/reference/androidx/lifecycle/ViewModelStoreOwner#getViewModelStore()()`

The owned `https://developer.android.com/reference/androidx/lifecycle/ViewModelStore`

## Constants

### BG_DARK

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public static final int BG_DARK = 1
```

A dark translucent background.

### BG_LIGHT

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public static final int BG_LIGHT = 2
```

A light translucent background.

### BG_NONE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public static final int BG_NONE = 0
```

No background.

## Public constructors

### PlaybackSupportFragment

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public PlaybackSupportFragment()
```

## Public methods

### fadeOut

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [fadeOut](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#fadeOut())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Call `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#hideControlsOverlay(boolean)`

Fades out the playback overlay immediately.

### getAdapter

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public ObjectAdapter getAdapter()
```

### getBackgroundType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public int getBackgroundType()
```

Returns the background type.

### getProgressBarManager

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public ProgressBarManager getProgressBarManager()
```

Returns the ProgressBarManager that will show or hide progress bar in `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onBufferingStateChanged(boolean)`.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/app/ProgressBarManager` | The ProgressBarManager that will show or hide progress bar in `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#onBufferingStateChanged(boolean)`. |

### hideControlsOverlay

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void hideControlsOverlay(boolean runAnimation)
```

Hide controls overlay.

| Parameters |
|---|---|
| `boolean runAnimation` | True to run animation, false otherwise. |

### isControlsOverlayAutoHideEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public boolean isControlsOverlayAutoHideEnabled()
```

Returns true if controls will be auto hidden after a delay when fragment is resumed.

### isControlsOverlayVisible

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public boolean isControlsOverlayVisible()
```

Returns true if controls overlay is visible, false otherwise.

| Returns |
|---|---|
| `boolean` | True if controls overlay is visible, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#showControlsOverlay(boolean)` |   |
| `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#hideControlsOverlay(boolean)` |   |

### isFadingEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public boolean [isFadingEnabled](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isFadingEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Uses `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isControlsOverlayAutoHideEnabled()`

### isShowOrHideControlsOverlayOnUserInteraction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public boolean isShowOrHideControlsOverlayOnUserInteraction()
```

Returns true if showing and auto-hiding controls when user interacts; false otherwise.

### notifyPlaybackRowChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void notifyPlaybackRowChanged()
```

Updates the ui when the row data changes.

### onCreate

```
public void onCreate(Bundle savedInstanceState)
```

Called to do initial creation of a fragment. This is called after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onAttach(android.app.Activity)` and before `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`.

Note that this can be called while the fragment's activity is still in the process of being created. As such, you can not rely on things like the activity's content view hierarchy being initialized at this point. If you want to do work once the activity itself is created, add a `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver` on the activity's Lifecycle, removing it when it receives the `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State#CREATED` callback.

Any restored child fragments will be created before the base `Fragment.onCreate` method returns.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If the fragment is being re-created from a previous saved state, this is the state. |

### onCreateView

```
public @Nullable View onCreateView(
    @NonNull LayoutInflater inflater,
    @Nullable ViewGroup container,
    @Nullable Bundle savedInstanceState
)
```

Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null. This will be called between `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreate(android.os.Bundle)` and `https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)`.

A default View can be returned by calling `https://developer.android.com/reference/androidx/fragment/app/Fragment#Fragment(int)` in your constructor. Otherwise, this method returns null.

It is recommended to **only** inflate the layout in this method and move logic that operates on the returned View to `https://developer.android.com/reference/androidx/fragment/app/Fragment#onViewCreated(android.view.View,android.os.Bundle)`.

If you return a View from here, you will later be called in `https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroyView()` when the view is being released.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate any views in the fragment, |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/ViewGroup.html container` | If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If non-null, this fragment is being re-constructed from a previous saved state as given here. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | Return the View for the fragment's UI, or null. |

### onDestroy

```
public void onDestroy()
```

Called when the fragment is no longer in use. This is called after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onStop()` and before `https://developer.android.com/reference/androidx/fragment/app/Fragment#onDetach()`.

### onDestroyView

```
public void onDestroyView()
```

Called when the view previously created by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has been detached from the fragment. The next time the fragment needs to be displayed, a new view will be created. This is called after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onStop()` and before `https://developer.android.com/reference/androidx/fragment/app/Fragment#onDestroy()`. It is called *regardless* of whether `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` returned a non-null view. Internally it is called after the view's state has been saved but before it has been removed from its parent.

### onPause

```
public void onPause()
```

Called when the Fragment is no longer resumed. This is generally tied to `https://developer.android.com/reference/android/app/Activity.html#onPause()` of the containing Activity's lifecycle.

### onResume

```
public void onResume()
```

Called when the fragment is visible to the user and actively running. This is generally tied to `https://developer.android.com/reference/android/app/Activity.html#onResume()` of the containing Activity's lifecycle.

### onStart

```
public void onStart()
```

Called when the Fragment is visible to the user. This is generally tied to `https://developer.android.com/reference/android/app/Activity.html#onStart()` of the containing Activity's lifecycle.

### onStop

```
public void onStop()
```

Called when the Fragment is no longer started. This is generally tied to `https://developer.android.com/reference/android/app/Activity.html#onStop()` of the containing Activity's lifecycle.

### onViewCreated

```
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
```

Called immediately after `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` has returned, but before any saved state has been restored in to the view. This gives subclasses a chance to initialize themselves once they know their view hierarchy has been completely created. The fragment's view hierarchy is not however attached to its parent at this point.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view` | The View returned by `https://developer.android.com/reference/androidx/fragment/app/Fragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If non-null, this fragment is being re-constructed from a previous saved state as given here. |

### setAdapter

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setAdapter(ObjectAdapter adapter)
```

Sets the list of rows for the fragment. A default `https://developer.android.com/reference/androidx/leanback/widget/ClassPresenterSelector` will be created if `https://developer.android.com/reference/androidx/leanback/widget/ObjectAdapter#getPresenterSelector()` is null. if user provides `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)` and `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter)`, the row and presenter will be set onto the adapter.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/ObjectAdapter adapter` | The adapter that contains related rows and optional playback row. |

### setBackgroundType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setBackgroundType(int type)
```

Sets the background type.

| Parameters |
|---|---|
| `int type` | One of BG_LIGHT, BG_DARK, or BG_NONE. |

### setControlsOverlayAutoHideEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setControlsOverlayAutoHideEnabled(boolean enabled)
```

Enables or disables auto hiding controls overlay after a short delay fragment is resumed. If enabled and fragment is resumed, the view will fade out after a time period. User interaction will kill the timer, next time fragment is resumed, the timer will be started again if `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#isControlsOverlayAutoHideEnabled()` is true.

In most cases app should not directly call setControlsOverlayAutoHideEnabled() as it's called by `https://developer.android.com/reference/androidx/leanback/media/PlaybackBaseControlGlue` on play or pause.

### setFadingEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setFadingEnabled](https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setFadingEnabled(boolean))(boolean enabled)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Uses `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setControlsOverlayAutoHideEnabled(boolean)`

### setHostCallback

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setHostCallback(PlaybackGlueHost.HostCallback hostCallback)
```

Sets the `https://developer.android.com/reference/androidx/leanback/media/PlaybackGlueHost.HostCallback`. Implementor of this interface will take appropriate actions to take action when the hosting fragment starts/stops processing.

### setOnItemViewClickedListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setOnItemViewClickedListener(BaseOnItemViewClickedListener listener)
```

This listener is called every time there is a click in `https://developer.android.com/reference/androidx/leanback/app/RowsSupportFragment`. This can be used by users to take additional actions such as animations.

### setOnItemViewSelectedListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setOnItemViewSelectedListener(BaseOnItemViewSelectedListener listener)
```

This listener is called every time there is a selection in `https://developer.android.com/reference/androidx/leanback/app/RowsSupportFragment`. This can be used by users to take additional actions such as animations.

### setOnKeyInterceptListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final void setOnKeyInterceptListener(View.OnKeyListener handler)
```

Sets the input event handler.

### setOnPlaybackItemViewClickedListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setOnPlaybackItemViewClickedListener(
    BaseOnItemViewClickedListener listener
)
```

Sets the `https://developer.android.com/reference/androidx/leanback/widget/BaseOnItemViewClickedListener` that would be invoked for clicks only on `https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter.ViewHolder`.

### setPlaybackRow

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setPlaybackRow(Row row)
```

Sets the playback row for the playback controls. The row will be set as first element of adapter if the adapter is `https://developer.android.com/reference/androidx/leanback/widget/ArrayObjectAdapter` or `https://developer.android.com/reference/androidx/leanback/widget/SparseArrayObjectAdapter`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/Row row` | The row that represents the playback. |

### setPlaybackRowPresenter

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setPlaybackRowPresenter(PlaybackRowPresenter presenter)
```

Sets the presenter for rendering the playback row set by `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)`. If adapter does not set a `https://developer.android.com/reference/androidx/leanback/widget/PresenterSelector`, `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setAdapter(androidx.leanback.widget.ObjectAdapter)` will create a `https://developer.android.com/reference/androidx/leanback/widget/ClassPresenterSelector` by default and map from the row object class to this `https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/PlaybackRowPresenter presenter` | Presenter used to render `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#setPlaybackRow(androidx.leanback.widget.Row)`. |

### setPlaybackSeekUiClient

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setPlaybackSeekUiClient(PlaybackSeekUi.Client client)
```

Interface to be implemented by UI widget to support PlaybackSeekUi.

### setSelectedPosition

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setSelectedPosition(int position)
```

Sets the selected row position with smooth animation.

### setSelectedPosition

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setSelectedPosition(int position, boolean smooth)
```

Sets the selected row position.

### setShowOrHideControlsOverlayOnUserInteraction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setShowOrHideControlsOverlayOnUserInteraction(
    boolean showOrHideControlsOverlayOnUserInteraction
)
```

Enables or disables showing and auto-hiding controls when user interacts. Enabled by default. Auto-hide timer length is defined by .

### showControlsOverlay

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void showControlsOverlay(boolean runAnimation)
```

Show controls overlay.

| Parameters |
|---|---|
| `boolean runAnimation` | True to run animation, false otherwise. |

### tickle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void tickle()
```

Tickles the playback controls. Fades in the view if it was faded out. `https://developer.android.com/reference/androidx/leanback/app/PlaybackSupportFragment#tickle()` will kill and re-create a timer if is positive.

In most cases app does not need call tickle() as it's automatically called on user interactions.

## Protected methods

### onBufferingStateChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void onBufferingStateChanged(boolean start)
```

Called when media has start or stop buffering. App may override. The default initial state is not buffering.

| Parameters |
|---|---|
| `boolean start` | True for buffering start, false otherwise. |

### onError

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void onError(int errorCode, CharSequence errorMessage)
```

Called when media has error. App may override.

| Parameters |
|---|---|
| `int errorCode` | Optional error code for specific implementation. |
| `https://developer.android.com/reference/java/lang/CharSequence.html errorMessage` | Optional error message for specific implementation. |

### onVideoSizeChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void onVideoSizeChanged(int videoWidth, int videoHeight)
```

Called when size of the video changes. App may override.

| Parameters |
|---|---|
| `int videoWidth` | Intrinsic width of video |
| `int videoHeight` | Intrinsic height of video |