# Fragment

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)   
belongs to Maven artifact com.android.support:support-fragment:28.0.0-alpha1  
Summary: [Nested Classes](https://developer.android.com/reference/android/support/v4/app/Fragment#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/support/v4/app/Fragment#pubctors) \| [Methods](https://developer.android.com/reference/android/support/v4/app/Fragment#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/support/v4/app/Fragment#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/v4/app/Fragment#)  

# Fragment

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public


class
Fragment
`


`

extends Object


`

`


implements

`[ComponentCallbacks](https://developer.android.com/reference/android/content/ComponentCallbacks.html)`,

`[View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html)`,

LifecycleOwner,

ViewModelStoreOwner


`

|---|---------------------------------|
| java.lang.Object                   ||
| ↳ | android.support.v4.app.Fragment |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)Known Direct Subclasses [AmbientModeSupport](https://developer.android.com/reference/android/support/wear/ambient/AmbientModeSupport),[BrandedSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BrandedSupportFragment),[DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment),[GuidedStepSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/GuidedStepSupportFragment),[HeadersSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/HeadersSupportFragment),[ListFragment](https://developer.android.com/reference/android/support/v4/app/ListFragment),[MediaRouteDiscoveryFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteDiscoveryFragment),[OnboardingSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/OnboardingSupportFragment),[PlaybackSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/PlaybackSupportFragment),[PreferenceFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat),[RowsSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/RowsSupportFragment),[SearchSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/SearchSupportFragment) |---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AmbientModeSupport](https://developer.android.com/reference/android/support/wear/ambient/AmbientModeSupport)                   | Use this as a headless Fragment to add ambient support to an Activity on Wearable devices.                                                                                                                       | | [BrandedSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BrandedSupportFragment)       | Fragment class for managing search and branding using a view that implements [TitleViewAdapter.Provider](https://developer.android.com/reference/android/support/v17/leanback/widget/TitleViewAdapter.Provider). | | [DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment)                                 | Static library support version of the framework's [DialogFragment](https://developer.android.com/reference/android/app/DialogFragment.html).                                                                     | | [GuidedStepSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/GuidedStepSupportFragment) | A GuidedStepSupportFragment is used to guide the user through a decision or series of decisions.                                                                                                                 | | [HeadersSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/HeadersSupportFragment)       | An fragment containing a list of row headers.                                                                                                                                                                    | | [ListFragment](https://developer.android.com/reference/android/support/v4/app/ListFragment)                                     | Static library support version of the framework's [ListFragment](https://developer.android.com/reference/android/app/ListFragment.html).                                                                         | | [MediaRouteDiscoveryFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteDiscoveryFragment)       | Media route discovery fragment.                                                                                                                                                                                  | | [OnboardingSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/OnboardingSupportFragment) | An OnboardingSupportFragment provides a common and simple way to build onboarding screen for applications.                                                                                                       | | [PlaybackSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/PlaybackSupportFragment)     | A fragment for displaying playback controls and related content.                                                                                                                                                 | | [PreferenceFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat)      | Shows a hierarchy of [Preference](https://developer.android.com/reference/android/support/v7/preference/Preference) objects as lists.                                                                            | | [RowsSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/RowsSupportFragment)             | An ordered set of rows of leanback widgets.                                                                                                                                                                      | | [SearchSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/SearchSupportFragment)         | A fragment to handle searches.                                                                                                                                                                                   | |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)Known Indirect Subclasses [AppCompatDialogFragment](https://developer.android.com/reference/android/support/v7/app/AppCompatDialogFragment),[BaseSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BaseSupportFragment),[BrowseSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BrowseSupportFragment),[DetailsSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/DetailsSupportFragment),[EditTextPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/EditTextPreferenceDialogFragmentCompat),[ErrorSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/ErrorSupportFragment),[ListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/ListPreferenceDialogFragmentCompat),[MediaRouteChooserDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteChooserDialogFragment),[MediaRouteControllerDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteControllerDialogFragment),[MultiSelectListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/MultiSelectListPreferenceDialogFragmentCompat),[PreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceDialogFragmentCompat),[VerticalGridSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/VerticalGridSupportFragment),[VideoSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/VideoSupportFragment) |----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AppCompatDialogFragment](https://developer.android.com/reference/android/support/v7/app/AppCompatDialogFragment)                                                    | A special version of [DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment) which uses an [AppCompatDialog](https://developer.android.com/reference/android/support/v7/app/AppCompatDialog) in place of a platform-styled dialog.            | | [BaseSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BaseSupportFragment)                                                  | Base class for leanback Fragments.                                                                                                                                                                                                                                                    | | [BrowseSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/BrowseSupportFragment)                                              | A fragment for creating Leanback browse screens.                                                                                                                                                                                                                                      | | [DetailsSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/DetailsSupportFragment)                                            | A fragment for creating Leanback details screens.                                                                                                                                                                                                                                     | | [EditTextPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/EditTextPreferenceDialogFragmentCompat)               |                                                                                                                                                                                                                                                                                       | | [ErrorSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/ErrorSupportFragment)                                                | A fragment for displaying an error indication.                                                                                                                                                                                                                                        | | [ListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/ListPreferenceDialogFragmentCompat)                       |                                                                                                                                                                                                                                                                                       | | [MediaRouteChooserDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteChooserDialogFragment)                                    | Media route chooser dialog fragment.                                                                                                                                                                                                                                                  | | [MediaRouteControllerDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteControllerDialogFragment)                              | Media route controller dialog fragment.                                                                                                                                                                                                                                               | | [MultiSelectListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/MultiSelectListPreferenceDialogFragmentCompat) |                                                                                                                                                                                                                                                                                       | | [PreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceDialogFragmentCompat)                               | Abstract base class which presents a dialog associated with a [DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference).                                                                                                             | | [VerticalGridSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/VerticalGridSupportFragment)                                  | A fragment for creating leanback vertical grids.                                                                                                                                                                                                                                      | | [VideoSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/VideoSupportFragment)                                                | Subclass of [PlaybackSupportFragment](https://developer.android.com/reference/android/support/v17/leanback/app/PlaybackSupportFragment) that is responsible for providing a [SurfaceView](https://developer.android.com/reference/android/view/SurfaceView.html) and rendering video. | ||

<br />

*** ** * ** ***

Static library support version of the framework's [Fragment](https://developer.android.com/reference/android/app/Fragment.html).
Used to write apps that run on platforms prior to Android 3.0. When running
on Android 3.0 or above, this implementation is still used; it does not try
to switch to the framework's implementation. See the framework [Fragment](https://developer.android.com/reference/android/app/Fragment.html)
documentation for a class overview.

The main differences when using this support version instead of the framework version are:

- Your activity must extend [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity)
- You must call [getSupportFragmentManager()](https://developer.android.com/reference/android/support/v4/app/FragmentActivity#getSupportFragmentManager()) to get the [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)

<br />

## Summary

|                                                                                                                                                                                   ### Nested classes                                                                                                                                                                                    ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [Fragment.InstantiationException](https://developer.android.com/reference/android/support/v4/app/Fragment.InstantiationException) Thrown by [instantiate(Context, String, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#instantiate(android.content.Context, java.lang.String, android.os.Bundle)) when there is an instantiation failure. |
| ` class` | [Fragment.SavedState](https://developer.android.com/reference/android/support/v4/app/Fragment.SavedState) State information that has been retrieved from a fragment instance through [FragmentManager.saveFragmentInstanceState](https://developer.android.com/reference/android/support/v4/app/FragmentManager#saveFragmentInstanceState(android.support.v4.app.Fragment)).  |

|                                                    ### Public constructors                                                     ||
|-----------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment#Fragment())`() ` Default constructor. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                      | ` `[dump](https://developer.android.com/reference/android/support/v4/app/Fragment#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))`(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) ` Print the Fragments's state into the given stream.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final boolean`                                                                                             | ` `[equals](https://developer.android.com/reference/android/support/v4/app/Fragment#equals(java.lang.Object))`(Object o) ` Subclasses can not override equals().                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) | ` `[getActivity](https://developer.android.com/reference/android/support/v4/app/Fragment#getActivity())`() ` Return the [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) this fragment is currently associated with.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` boolean`                                                                                                   | ` `[getAllowEnterTransitionOverlap](https://developer.android.com/reference/android/support/v4/app/Fragment#getAllowEnterTransitionOverlap())`() ` Returns whether the the exit transition and enter transition overlap or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` boolean`                                                                                                   | ` `[getAllowReturnTransitionOverlap](https://developer.android.com/reference/android/support/v4/app/Fragment#getAllowReturnTransitionOverlap())`() ` Returns whether the the return transition and reenter transition overlap or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                            | ` `[getArguments](https://developer.android.com/reference/android/support/v4/app/Fragment#getArguments())`() ` Return the arguments supplied when the fragment was instantiated, if any.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` final `[FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)   | ` `[getChildFragmentManager](https://developer.android.com/reference/android/support/v4/app/Fragment#getChildFragmentManager())`() ` Return a private FragmentManager for placing and managing Fragments inside of this Fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` `[Context](https://developer.android.com/reference/android/content/Context.html)                           | ` `[getContext](https://developer.android.com/reference/android/support/v4/app/Fragment#getContext())`() ` Return the [Context](https://developer.android.com/reference/android/content/Context.html) this fragment is currently associated with.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` Object`                                                                                                    | ` `[getEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#getEnterTransition())`() ` Returns the Transition that will be used to move Views into the initial scene.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` Object`                                                                                                    | ` `[getExitTransition](https://developer.android.com/reference/android/support/v4/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 `[FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)   | ` `[getFragmentManager](https://developer.android.com/reference/android/support/v4/app/Fragment#getFragmentManager())`() ` Return the FragmentManager for interacting with fragments associated with this fragment's activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` final Object`                                                                                              | ` `[getHost](https://developer.android.com/reference/android/support/v4/app/Fragment#getHost())`() ` Return the host object of this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final int`                                                                                                 | ` `[getId](https://developer.android.com/reference/android/support/v4/app/Fragment#getId())`() ` Return the identifier this fragment is known by.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final `[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)          | ` `[getLayoutInflater](https://developer.android.com/reference/android/support/v4/app/Fragment#getLayoutInflater())`() ` Returns the cached LayoutInflater used to inflate Views of this Fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` Lifecycle`                                                                                                 | ` `[getLifecycle](https://developer.android.com/reference/android/support/v4/app/Fragment#getLifecycle())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` `[LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)             | ` `[getLoaderManager](https://developer.android.com/reference/android/support/v4/app/Fragment#getLoaderManager())`() ` Return the LoaderManager for this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` final `[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)                 | ` `[getParentFragment](https://developer.android.com/reference/android/support/v4/app/Fragment#getParentFragment())`() ` Returns the parent Fragment containing this Fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` Object`                                                                                                    | ` `[getReenterTransition](https://developer.android.com/reference/android/support/v4/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 `[Resources](https://developer.android.com/reference/android/content/res/Resources.html)             | ` `[getResources](https://developer.android.com/reference/android/support/v4/app/Fragment#getResources())`() ` Return `requireActivity().getResources()`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final boolean`                                                                                             | ` `[getRetainInstance](https://developer.android.com/reference/android/support/v4/app/Fragment#getRetainInstance())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` Object`                                                                                                    | ` `[getReturnTransition](https://developer.android.com/reference/android/support/v4/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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` Object`                                                                                                    | ` `[getSharedElementEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#getSharedElementEnterTransition())`() ` Returns the Transition that will be used for shared elements transferred into the content Scene.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` Object`                                                                                                    | ` `[getSharedElementReturnTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#getSharedElementReturnTransition())`() ` Return the Transition that will be used for shared elements transferred back during a pop of the back stack.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final String`                                                                                              | ` `[getString](https://developer.android.com/reference/android/support/v4/app/Fragment#getString(int, java.lang.Object...))`(int resId, Object... formatArgs) ` Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in [Formatter](https://developer.android.com/reference/java/util/Formatter) and [format(String, Object...)](https://developer.android.com/reference/java/lang/String#format(java.lang.String, java.lang.Object...)).                                                                                                                                                                                                                                                                                                                                                                                       |
| ` final String`                                                                                              | ` `[getString](https://developer.android.com/reference/android/support/v4/app/Fragment#getString(int))`(int resId) ` Return a localized string from the application's package's default string table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final String`                                                                                              | ` `[getTag](https://developer.android.com/reference/android/support/v4/app/Fragment#getTag())`() ` Get the tag name of the fragment, if specified.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` final `[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)                 | ` `[getTargetFragment](https://developer.android.com/reference/android/support/v4/app/Fragment#getTargetFragment())`() ` Return the target fragment set by [setTargetFragment(Fragment, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#setTargetFragment(android.support.v4.app.Fragment, int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final int`                                                                                                 | ` `[getTargetRequestCode](https://developer.android.com/reference/android/support/v4/app/Fragment#getTargetRequestCode())`() ` Return the target request code set by [setTargetFragment(Fragment, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#setTargetFragment(android.support.v4.app.Fragment, int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final CharSequence`                                                                                        | ` `[getText](https://developer.android.com/reference/android/support/v4/app/Fragment#getText(int))`(int resId) ` Return a localized, styled CharSequence from the application's package's default string table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` boolean`                                                                                                   | ` `[getUserVisibleHint](https://developer.android.com/reference/android/support/v4/app/Fragment#getUserVisibleHint())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` `[View](https://developer.android.com/reference/android/view/View.html)                                    | ` `[getView](https://developer.android.com/reference/android/support/v4/app/Fragment#getView())`() ` Get the root view for the fragment's layout (the one returned by [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))), if provided.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` ViewModelStore`                                                                                            | ` `[getViewModelStore](https://developer.android.com/reference/android/support/v4/app/Fragment#getViewModelStore())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` final int`                                                                                                 | ` `[hashCode](https://developer.android.com/reference/android/support/v4/app/Fragment#hashCode())`() ` Subclasses can not override hashCode().                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` static `[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)                | ` `[instantiate](https://developer.android.com/reference/android/support/v4/app/Fragment#instantiate(android.content.Context, java.lang.String))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, String fname) ` Like [instantiate(Context, String, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#instantiate(android.content.Context, java.lang.String, android.os.Bundle)) but with a null argument Bundle.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` static `[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)                | ` `[instantiate](https://developer.android.com/reference/android/support/v4/app/Fragment#instantiate(android.content.Context, java.lang.String, android.os.Bundle))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, String fname, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` args) ` Create a new instance of a Fragment with the given class name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final boolean`                                                                                             | ` `[isAdded](https://developer.android.com/reference/android/support/v4/app/Fragment#isAdded())`() ` Return true if the fragment is currently added to its activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final boolean`                                                                                             | ` `[isDetached](https://developer.android.com/reference/android/support/v4/app/Fragment#isDetached())`() ` Return true if the fragment has been explicitly detached from the UI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final boolean`                                                                                             | ` `[isHidden](https://developer.android.com/reference/android/support/v4/app/Fragment#isHidden())`() ` Return true if the fragment has been hidden.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final boolean`                                                                                             | ` `[isInLayout](https://developer.android.com/reference/android/support/v4/app/Fragment#isInLayout())`() ` Return true if the layout is included as part of an activity view hierarchy via the \<fragment\> tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final boolean`                                                                                             | ` `[isRemoving](https://developer.android.com/reference/android/support/v4/app/Fragment#isRemoving())`() ` Return true if this fragment is currently being removed from its activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final boolean`                                                                                             | ` `[isResumed](https://developer.android.com/reference/android/support/v4/app/Fragment#isResumed())`() ` Return true if the fragment is in the resumed state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final boolean`                                                                                             | ` `[isStateSaved](https://developer.android.com/reference/android/support/v4/app/Fragment#isStateSaved())`() ` Returns true if this fragment is added and its state has already been saved by its host.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final boolean`                                                                                             | ` `[isVisible](https://developer.android.com/reference/android/support/v4/app/Fragment#isVisible())`() ` Return true if the fragment is currently visible to the user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[onActivityCreated](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Called when the fragment's activity has been created and this fragment's view hierarchy instantiated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                                      | ` `[onActivityResult](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityResult(int, int, android.content.Intent))`(int requestCode, int resultCode, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` data) ` Receive the result from a previous call to [startActivityForResult(Intent, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#startActivityForResult(android.content.Intent, int)).                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` void`                                                                                                      | ` `[onAttach](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity) ` *This method was deprecated in API level 24.1.0. See [onAttach(Context)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.content.Context)).*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                      | ` `[onAttach](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Called when a fragment is first attached to its context.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                      | ` `[onAttachFragment](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttachFragment(android.support.v4.app.Fragment))`(`[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)` childFragment) ` Called when a fragment is attached as a child of this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                      | ` `[onConfigurationChanged](https://developer.android.com/reference/android/support/v4/app/Fragment#onConfigurationChanged(android.content.res.Configuration))`(`[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` newConfig) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                                                   | ` `[onContextItemSelected](https://developer.android.com/reference/android/support/v4/app/Fragment#onContextItemSelected(android.view.MenuItem))`(`[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)` item) ` This hook is called whenever an item in a context menu is selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                      | ` `[onCreate](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Called to do initial creation of a fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` `[Animation](https://developer.android.com/reference/android/view/animation/Animation.html)                | ` `[onCreateAnimation](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateAnimation(int, boolean, int))`(int transit, boolean enter, int nextAnim) ` Called when a fragment loads an animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` `[Animator](https://developer.android.com/reference/android/animation/Animator.html)                       | ` `[onCreateAnimator](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateAnimator(int, boolean, int))`(int transit, boolean enter, int nextAnim) ` Called when a fragment loads an animator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` void`                                                                                                      | ` `[onCreateContextMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo))`(`[ContextMenu](https://developer.android.com/reference/android/view/ContextMenu.html)` menu, `[View](https://developer.android.com/reference/android/view/View.html)` v, `[ContextMenu.ContextMenuInfo](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`                                                                                                      | ` `[onCreateOptionsMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))`(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` menu, `[MenuInflater](https://developer.android.com/reference/android/view/MenuInflater.html)` inflater) ` Initialize the contents of the Fragment host's standard options menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` `[View](https://developer.android.com/reference/android/view/View.html)                                    | ` `[onCreateView](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))`(`[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)` inflater, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)` container, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Called to have the fragment instantiate its user interface view.                                                                                                                                                                                                                                                                                                                                                            |
| ` void`                                                                                                      | ` `[onDestroy](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroy())`() ` Called when the fragment is no longer in use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[onDestroyOptionsMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroyOptionsMenu())`() ` Called when this fragment's option menu items are no longer being included in the overall options menu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[onDestroyView](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroyView())`() ` Called when the view previously created by [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)) has been detached from the fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                      | ` `[onDetach](https://developer.android.com/reference/android/support/v4/app/Fragment#onDetach())`() ` Called when the fragment is no longer attached to its activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)                | ` `[onGetLayoutInflater](https://developer.android.com/reference/android/support/v4/app/Fragment#onGetLayoutInflater(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Returns the LayoutInflater used to inflate Views of this Fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                      | ` `[onHiddenChanged](https://developer.android.com/reference/android/support/v4/app/Fragment#onHiddenChanged(boolean))`(boolean hidden) ` Called when the hidden state (as returned by [isHidden()](https://developer.android.com/reference/android/support/v4/app/Fragment#isHidden()) of the fragment has changed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` void`                                                                                                      | ` `[onInflate](https://developer.android.com/reference/android/support/v4/app/Fragment#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` attrs, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` *This method was deprecated in API level 24.1.0. See [onInflate(Context, AttributeSet, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle)).*                                                                                                                                                                                      |
| ` void`                                                                                                      | ` `[onInflate](https://developer.android.com/reference/android/support/v4/app/Fragment#onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` attrs, `[Bundle](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`                                                                                                      | ` `[onLowMemory](https://developer.android.com/reference/android/support/v4/app/Fragment#onLowMemory())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                                      | ` `[onMultiWindowModeChanged](https://developer.android.com/reference/android/support/v4/app/Fragment#onMultiWindowModeChanged(boolean))`(boolean isInMultiWindowMode) ` Called when the Fragment's activity changes from fullscreen mode to multi-window mode and visa-versa.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                                                   | ` `[onOptionsItemSelected](https://developer.android.com/reference/android/support/v4/app/Fragment#onOptionsItemSelected(android.view.MenuItem))`(`[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)` item) ` This hook is called whenever an item in your options menu is selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                      | ` `[onOptionsMenuClosed](https://developer.android.com/reference/android/support/v4/app/Fragment#onOptionsMenuClosed(android.view.Menu))`(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` menu) ` This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                      | ` `[onPause](https://developer.android.com/reference/android/support/v4/app/Fragment#onPause())`() ` Called when the Fragment is no longer resumed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                      | ` `[onPictureInPictureModeChanged](https://developer.android.com/reference/android/support/v4/app/Fragment#onPictureInPictureModeChanged(boolean))`(boolean isInPictureInPictureMode) ` Called by the system when the activity changes to and from picture-in-picture mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                                      | ` `[onPrepareOptionsMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#onPrepareOptionsMenu(android.view.Menu))`(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` menu) ` Prepare the Fragment host's standard options menu to be displayed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                      | ` `[onRequestPermissionsResult](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[]))`(int requestCode, String[] permissions, int[] grantResults) ` Callback for the result from requesting permissions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[onResume](https://developer.android.com/reference/android/support/v4/app/Fragment#onResume())`() ` Called when the fragment is visible to the user and actively running.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                                      | ` `[onSaveInstanceState](https://developer.android.com/reference/android/support/v4/app/Fragment#onSaveInstanceState(android.os.Bundle))`(`[Bundle](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 of its process is restarted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                      | ` `[onStart](https://developer.android.com/reference/android/support/v4/app/Fragment#onStart())`() ` Called when the Fragment is visible to the user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` void`                                                                                                      | ` `[onStop](https://developer.android.com/reference/android/support/v4/app/Fragment#onStop())`() ` Called when the Fragment is no longer started.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                      | ` `[onViewCreated](https://developer.android.com/reference/android/support/v4/app/Fragment#onViewCreated(android.view.View, android.os.Bundle))`(`[View](https://developer.android.com/reference/android/view/View.html)` view, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Called immediately after [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/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`                                                                                                      | ` `[onViewStateRestored](https://developer.android.com/reference/android/support/v4/app/Fragment#onViewStateRestored(android.os.Bundle))`(`[Bundle](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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                      | ` `[postponeEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#postponeEnterTransition())`() ` Postpone the entering Fragment transition until [startPostponedEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#startPostponedEnterTransition()) or [executePendingTransactions()](https://developer.android.com/reference/android/support/v4/app/FragmentManager#executePendingTransactions()) has been called.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                      | ` `[registerForContextMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#registerForContextMenu(android.view.View))`(`[View](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).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final void`                                                                                                | ` `[requestPermissions](https://developer.android.com/reference/android/support/v4/app/Fragment#requestPermissions(java.lang.String[], int))`(String[] permissions, int requestCode) ` Requests permissions to be granted to this application.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` final `[FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) | ` `[requireActivity](https://developer.android.com/reference/android/support/v4/app/Fragment#requireActivity())`() ` Return the [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) this fragment is currently associated with.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final `[Context](https://developer.android.com/reference/android/content/Context.html)                     | ` `[requireContext](https://developer.android.com/reference/android/support/v4/app/Fragment#requireContext())`() ` Return the [Context](https://developer.android.com/reference/android/content/Context.html) this fragment is currently associated with.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final `[FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)   | ` `[requireFragmentManager](https://developer.android.com/reference/android/support/v4/app/Fragment#requireFragmentManager())`() ` Return the FragmentManager for interacting with fragments associated with this fragment's activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final Object`                                                                                              | ` `[requireHost](https://developer.android.com/reference/android/support/v4/app/Fragment#requireHost())`() ` Return the host object of this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` void`                                                                                                      | ` `[setAllowEnterTransitionOverlap](https://developer.android.com/reference/android/support/v4/app/Fragment#setAllowEnterTransitionOverlap(boolean))`(boolean allow) ` Sets whether the the exit transition and enter transition overlap or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                      | ` `[setAllowReturnTransitionOverlap](https://developer.android.com/reference/android/support/v4/app/Fragment#setAllowReturnTransitionOverlap(boolean))`(boolean allow) ` Sets whether the the return transition and reenter transition overlap or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[setArguments](https://developer.android.com/reference/android/support/v4/app/Fragment#setArguments(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` args) ` Supply the construction arguments for this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                      | ` `[setEnterSharedElementCallback](https://developer.android.com/reference/android/support/v4/app/Fragment#setEnterSharedElementCallback(android.support.v4.app.SharedElementCallback))`(`[SharedElementCallback](https://developer.android.com/reference/android/support/v4/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`                                                                                                      | ` `[setEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setEnterTransition(java.lang.Object))`(Object transition) ` Sets the Transition that will be used to move Views into the initial scene.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` void`                                                                                                      | ` `[setExitSharedElementCallback](https://developer.android.com/reference/android/support/v4/app/Fragment#setExitSharedElementCallback(android.support.v4.app.SharedElementCallback))`(`[SharedElementCallback](https://developer.android.com/reference/android/support/v4/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`                                                                                                      | ` `[setExitTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setExitTransition(java.lang.Object))`(Object 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/android/support/v4/app/Fragment#setHasOptionsMenu(boolean))`(boolean hasMenu) ` Report that this fragment would like to participate in populating the options menu by receiving a call to [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater)) and related methods.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` void`                                                                                                      | ` `[setInitialSavedState](https://developer.android.com/reference/android/support/v4/app/Fragment#setInitialSavedState(android.support.v4.app.Fragment.SavedState))`(`[Fragment.SavedState](https://developer.android.com/reference/android/support/v4/app/Fragment.SavedState)` state) ` Set the initial saved state that this Fragment should restore itself from when first being constructed, as returned by [FragmentManager.saveFragmentInstanceState](https://developer.android.com/reference/android/support/v4/app/FragmentManager#saveFragmentInstanceState(android.support.v4.app.Fragment)).                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                      | ` `[setMenuVisibility](https://developer.android.com/reference/android/support/v4/app/Fragment#setMenuVisibility(boolean))`(boolean menuVisible) ` Set a hint for whether this fragment's menu should be visible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                      | ` `[setReenterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setReenterTransition(java.lang.Object))`(Object 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/android/support/v4/app/Fragment#setRetainInstance(boolean))`(boolean retain) ` Control whether a fragment instance is retained across Activity re-creation (such as from a configuration change).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                                      | ` `[setReturnTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setReturnTransition(java.lang.Object))`(Object 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`                                                                                                      | ` `[setSharedElementEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setSharedElementEnterTransition(java.lang.Object))`(Object transition) ` Sets the Transition that will be used for shared elements transferred into the content Scene.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                      | ` `[setSharedElementReturnTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#setSharedElementReturnTransition(java.lang.Object))`(Object 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/android/support/v4/app/Fragment#setTargetFragment(android.support.v4.app.Fragment, int))`(`[Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)` fragment, int requestCode) ` Optional target for this fragment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                      | ` `[setUserVisibleHint](https://developer.android.com/reference/android/support/v4/app/Fragment#setUserVisibleHint(boolean))`(boolean isVisibleToUser) ` Set a hint to the system about whether this fragment's UI is currently visible to the user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` boolean`                                                                                                   | ` `[shouldShowRequestPermissionRationale](https://developer.android.com/reference/android/support/v4/app/Fragment#shouldShowRequestPermissionRationale(java.lang.String))`(String permission) ` Gets whether you should show UI with rationale for requesting a permission.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                                      | ` `[startActivity](https://developer.android.com/reference/android/support/v4/app/Fragment#startActivity(android.content.Intent))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent) ` Call [startActivity(Intent)](https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)) from the fragment's containing Activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                                      | ` `[startActivity](https://developer.android.com/reference/android/support/v4/app/Fragment#startActivity(android.content.Intent, android.os.Bundle))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Call [startActivity(Intent, Bundle)](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/android/support/v4/app/Fragment#startActivityForResult(android.content.Intent, int))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent, int requestCode) ` Call [startActivityForResult(Intent, int)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)) from the fragment's containing Activity.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                      | ` `[startActivityForResult](https://developer.android.com/reference/android/support/v4/app/Fragment#startActivityForResult(android.content.Intent, int, android.os.Bundle))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent, int requestCode, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Call [startActivityForResult(Intent, int, Bundle)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int, android.os.Bundle)) from the fragment's containing Activity.                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                      | ` `[startIntentSenderForResult](https://developer.android.com/reference/android/support/v4/app/Fragment#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle))`(`[IntentSender](https://developer.android.com/reference/android/content/IntentSender.html)` intent, int requestCode, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` fillInIntent, int flagsMask, int flagsValues, int extraFlags, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Call [startIntentSenderForResult(IntentSender, int, Intent, int, int, int, Bundle)](https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)) from the fragment's containing Activity. |
| ` void`                                                                                                      | ` `[startPostponedEnterTransition](https://developer.android.com/reference/android/support/v4/app/Fragment#startPostponedEnterTransition())`() ` Begin postponed transitions after [postponeEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#postponeEnterTransition()) was called.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` String`                                                                                                    | ` `[toString](https://developer.android.com/reference/android/support/v4/app/Fragment#toString())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                      | ` `[unregisterForContextMenu](https://developer.android.com/reference/android/support/v4/app/Fragment#unregisterForContextMenu(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View.html)` view) ` Prevents a context menu to be shown for the given view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)From interface ` `[android.content.ComponentCallbacks](https://developer.android.com/reference/android/content/ComponentCallbacks.html)` ` |------------------|------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onConfigurationChanged(`[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` arg0) ` | | ` abstract void` | ` onLowMemory() `                                                                                                                  | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)From interface ` `[android.view.View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html)` ` |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onCreateContextMenu(`[ContextMenu](https://developer.android.com/reference/android/view/ContextMenu.html)` arg0, `[View](https://developer.android.com/reference/android/view/View.html)` arg1, `[ContextMenu.ContextMenuInfo](https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html)` arg2) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)From interface ` android.arch.lifecycle.LifecycleOwner ` |-----------------------|--------------------| | ` abstract Lifecycle` | ` getLifecycle() ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/app/Fragment#)From interface ` android.arch.lifecycle.ViewModelStoreOwner ` |----------------------------|-------------------------| | ` abstract ViewModelStore` | ` getViewModelStore() ` | ||

## Public constructors

### Fragment

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Fragment ()
```

Default constructor. **Every** fragment must have an
empty constructor, so it can be instantiated when restoring its
activity's state. It is strongly recommended that subclasses do not
have other constructors with parameters, since these constructors
will not be called when the fragment is re-instantiated; instead,
arguments can be supplied by the caller with [setArguments(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#setArguments(android.os.Bundle))
and later retrieved by the Fragment with [getArguments()](https://developer.android.com/reference/android/support/v4/app/Fragment#getArguments()).

Applications should generally not implement a constructor. Prefer
[onAttach(Context)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.content.Context)) instead. It is the first place application code can run where
the fragment is ready to be used - the point where the fragment is actually associated with
its context. Some applications may also want to implement [onInflate(Activity, AttributeSet, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle)) to retrieve
attributes from a layout resource, although note this happens when the fragment is attached.

<br />

## Public methods

### dump

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void dump (String prefix, 
                FileDescriptor fd, 
                PrintWriter writer, 
                String[] args)
```

Print the Fragments's state into the given stream.

<br />

|                                                             Parameters                                                             ||
|----------|--------------------------------------------------------------------------------------------------------------------------|
| `prefix` | `String`: Text to print at the front of each line. <br />                                                                |
| `fd`     | `FileDescriptor`: The raw file descriptor that the dump is being sent to. <br />                                         |
| `writer` | `PrintWriter`: The PrintWriter to which you should dump your state. This will be closed for you after you return. <br /> |
| `args`   | `String`: additional arguments to the dump request. <br />                                                               |

### equals

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean equals (Object o)
```

Subclasses can not override equals().

<br />

|      Parameters      ||
|-----|-----------------|
| `o` | `Object` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### getActivity

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FragmentActivity getActivity ()
```

Return the [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) this fragment is currently associated with.
May return `null` if the fragment is associated with a [Context](https://developer.android.com/reference/android/content/Context.html)
instead.

<br />

|                                                   Returns                                                   ||
|-----------------------------------------------------------------------------------------------------|--------|
| [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) | <br /> |

**See also:**

- [requireActivity()](https://developer.android.com/reference/android/support/v4/app/Fragment#requireActivity())  

### getAllowEnterTransitionOverlap

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean getAllowEnterTransitionOverlap ()
```

Returns whether the the exit transition and enter transition overlap or not.
When true, the enter transition will start as soon as possible. When false, the
enter transition will wait until the exit transition completes before starting.

<br />

|                                                                          Returns                                                                          ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | true when the enter transition should start as soon as possible or false to when it should wait until the exiting transition completes. <br /> |

### getAllowReturnTransitionOverlap

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean getAllowReturnTransitionOverlap ()
```

Returns whether the the return transition and reenter transition overlap or not.
When true, the reenter transition will start as soon as possible. When false, the
reenter transition will wait until the return transition completes before starting.

<br />

|                                                           Returns                                                            ||
|-----------|-------------------------------------------------------------------------------------------------------------------|
| `boolean` | true to start the reenter transition when possible or false to wait until the return transition completes. <br /> |

### getArguments

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Bundle getArguments ()
```

Return the arguments supplied when the fragment was instantiated,
if any.

<br />

|                                     Returns                                      ||
|--------------------------------------------------------------------------|--------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html) | <br /> |

### getChildFragmentManager

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FragmentManager getChildFragmentManager ()
```

Return a private FragmentManager for placing and managing Fragments
inside of this Fragment.

<br />

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager) | <br /> |

### getContext

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Context getContext ()
```

Return the [Context](https://developer.android.com/reference/android/content/Context.html) this fragment is currently associated with.

<br />

|                                         Returns                                         ||
|---------------------------------------------------------------------------------|--------|
| [Context](https://developer.android.com/reference/android/content/Context.html) | <br /> |

**See also:**

- [requireContext()](https://developer.android.com/reference/android/support/v4/app/Fragment#requireContext())  

### getEnterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getEnterTransition ()
```

Returns the Transition that will be used to move Views into the initial scene. The entering
Views will be those that are regular Views or ViewGroups that have
[isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as entering is governed by changing visibility from
[INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE) to [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE).

<br />

|                                   Returns                                    ||
|----------|--------------------------------------------------------------------|
| `Object` | the Transition to use to move Views into the initial Scene. <br /> |

### getExitTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object 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.
The exiting Views will be those that are regular Views or ViewGroups that
have [isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as exiting is governed by changing visibility
from [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If transition is null, the views will
remain unaffected.

<br />

|                                                                  Returns                                                                   ||
|----------|----------------------------------------------------------------------------------------------------------------------------------|
| `Object` | the Transition to use to move Views out of the Scene when the Fragment is being closed not due to popping the back stack. <br /> |

### getFragmentManager

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FragmentManager getFragmentManager ()
```

Return the FragmentManager for interacting with fragments associated
with this fragment's activity. Note that this will be non-null slightly
before [getActivity()](https://developer.android.com/reference/android/support/v4/app/Fragment#getActivity()), during the time from when the fragment is
placed in a [FragmentTransaction](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction) until it is committed and
attached to its activity.

If this Fragment is a child of another Fragment, the FragmentManager
returned here will be the parent's [getChildFragmentManager()](https://developer.android.com/reference/android/support/v4/app/Fragment#getChildFragmentManager()).

<br />

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager) | <br /> |

**See also:**

- [requireFragmentManager()](https://developer.android.com/reference/android/support/v4/app/Fragment#requireFragmentManager())  

### getHost

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getHost ()
```

Return the host object of this fragment. May return `null` if the fragment
isn't currently being hosted.

<br />

|     Returns      ||
|----------|--------|
| `Object` | <br /> |

**See also:**

- [requireHost()](https://developer.android.com/reference/android/support/v4/app/Fragment#requireHost())  

### getId

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getId ()
```

Return the identifier this fragment is known by. This is either
the android:id value supplied in a layout or the container view ID
supplied when adding the fragment.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getLayoutInflater

added in [version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
LayoutInflater getLayoutInflater ()
```

Returns the cached LayoutInflater used to inflate Views of this Fragment. If
[onGetLayoutInflater(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onGetLayoutInflater(android.os.Bundle)) has not been called [onGetLayoutInflater(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onGetLayoutInflater(android.os.Bundle))
will be called with a `null` argument and that value will be cached.


The cached LayoutInflater will be replaced immediately prior to
[onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)) and cleared immediately after
[onDetach()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDetach()).

<br />

|                                                                            Returns                                                                            ||
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html) | The LayoutInflater used to inflate Views of this Fragment. <br /> |

### getLifecycle

added in [version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Lifecycle getLifecycle ()
```

<br />

<br />

|       Returns       ||
|-------------|--------|
| `Lifecycle` | <br /> |

### getLoaderManager

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
LoaderManager getLoaderManager ()
```

Return the LoaderManager for this fragment.

<br />

|                                                Returns                                                ||
|-----------------------------------------------------------------------------------------------|--------|
| [LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager) | <br /> |

### getParentFragment

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Fragment getParentFragment ()
```

Returns the parent Fragment containing this Fragment. If this Fragment
is attached directly to an Activity, returns null.

<br />

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment) | <br /> |

### getReenterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getReenterTransition ()
```

Returns the Transition that will be used to move Views in to the scene when returning due
to popping a back stack. The entering Views will be those that are regular Views
or ViewGroups that have [isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions
will extend [Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as exiting is governed by changing
visibility from [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If transition is null,
the views will remain unaffected. If nothing is set, the default will be to use the same
transition as [setExitTransition(Object)](https://developer.android.com/reference/android/support/v4/app/Fragment#setExitTransition(java.lang.Object)).

<br />

|                                                         Returns                                                         ||
|----------|---------------------------------------------------------------------------------------------------------------|
| `Object` | the Transition to use to move Views into the scene when reentering from a previously-started Activity. <br /> |

### getResources

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Resources getResources ()
```

Return `requireActivity().getResources()`.

<br />

|                                             Returns                                             ||
|-----------------------------------------------------------------------------------------|--------|
| [Resources](https://developer.android.com/reference/android/content/res/Resources.html) | <br /> |

### getRetainInstance

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean getRetainInstance ()
```

<br />

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### getReturnTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object 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. The exiting
Views will be those that are regular Views or ViewGroups that have
[isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as entering is governed by changing visibility from
[VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If `transition` is null,
entering Views will remain unaffected.

<br />

|                                                    Returns                                                     ||
|----------|------------------------------------------------------------------------------------------------------|
| `Object` | the Transition to use to move Views out of the Scene when the Fragment is preparing to close. <br /> |

### getSharedElementEnterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getSharedElementEnterTransition ()
```

Returns the Transition that will be used for shared elements transferred into the content
Scene. Typical Transitions will affect size and location, such as
[ChangeBounds](https://developer.android.com/reference/android/transition/ChangeBounds.html). A null
value will cause transferred shared elements to blink to the final position.

<br />

|                                            Returns                                             ||
|----------|--------------------------------------------------------------------------------------|
| `Object` | The Transition to use for shared elements transferred into the content Scene. <br /> |

### getSharedElementReturnTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getSharedElementReturnTransition ()
```

Return the Transition that will be used for shared elements transferred back during a
pop of the back stack. This Transition acts in the leaving Fragment.
Typical Transitions will affect size and location, such as
[ChangeBounds](https://developer.android.com/reference/android/transition/ChangeBounds.html). A null
value will cause transferred shared elements to blink to the final position.
If no value is set, the default will be to use the same value as
[setSharedElementEnterTransition(Object)](https://developer.android.com/reference/android/support/v4/app/Fragment#setSharedElementEnterTransition(java.lang.Object)).

<br />

|                                             Returns                                              ||
|----------|----------------------------------------------------------------------------------------|
| `Object` | The Transition to use for shared elements transferred out of the content Scene. <br /> |

### getString

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getString (int resId, 
                Object... formatArgs)
```

Return a localized formatted string from the application's package's
default string table, substituting the format arguments as defined in
[Formatter](https://developer.android.com/reference/java/util/Formatter) and [format(String, Object...)](https://developer.android.com/reference/java/lang/String#format(java.lang.String, java.lang.Object...)).

<br />

|                                       Parameters                                        ||
|--------------|---------------------------------------------------------------------------|
| `resId`      | `int`: Resource id for the format string <br />                           |
| `formatArgs` | `Object`: The format arguments that will be used for substitution. <br /> |

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getString

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getString (int resId)
```

Return a localized string from the application's package's
default string table.

<br />

|                    Parameters                     ||
|---------|------------------------------------------|
| `resId` | `int`: Resource id for the string <br /> |

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getTag

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getTag ()
```

Get the tag name of the fragment, if specified.

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### getTargetFragment

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Fragment getTargetFragment ()
```

Return the target fragment set by [setTargetFragment(Fragment, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#setTargetFragment(android.support.v4.app.Fragment, int)).

<br />

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment) | <br /> |

### getTargetRequestCode

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getTargetRequestCode ()
```

Return the target request code set by [setTargetFragment(Fragment, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#setTargetFragment(android.support.v4.app.Fragment, int)).

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getText

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CharSequence getText (int resId)
```

Return a localized, styled CharSequence from the application's package's
default string table.

<br />

|                          Parameters                          ||
|---------|-----------------------------------------------------|
| `resId` | `int`: Resource id for the CharSequence text <br /> |

|        Returns         ||
|----------------|--------|
| `CharSequence` | <br /> |

### getUserVisibleHint

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean getUserVisibleHint ()
```

<br />

<br />

|                                    Returns                                     ||
|-----------|---------------------------------------------------------------------|
| `boolean` | The current value of the user-visible hint on this fragment. <br /> |

**See also:**

- [setUserVisibleHint(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#setUserVisibleHint(boolean))  

### getView

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
View getView ()
```

Get the root view for the fragment's layout (the one returned by [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))),
if provided.

<br />

|                                                                Returns                                                                ||
|------------------------------------------------------------------------|---------------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | The fragment's root view, or null if it has no layout. <br /> |

### getViewModelStore

added in [version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ViewModelStore getViewModelStore ()
```

<br />

<br />

|         Returns          ||
|------------------|--------|
| `ViewModelStore` | <br /> |

### hashCode

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int hashCode ()
```

Subclasses can not override hashCode().

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### instantiate

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Fragment instantiate (Context context,
                String fname)
```

Like [instantiate(Context, String, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#instantiate(android.content.Context, java.lang.String, android.os.Bundle)) but with a null
argument Bundle.

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |
| `fname`   | `String` <br />  |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment) | <br /> |

### instantiate

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Fragment instantiate (Context context,
                String fname, 
                Bundle args)
```

Create a new instance of a Fragment with the given class name. This is
the same as calling its empty constructor.

<br />

|                                                                                                          Parameters                                                                                                          ||
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context` | `Context`: The calling context being used to instantiate the fragment. This is currently just used to get its ClassLoader. <br />                                                                                 |
| `fname`   | `String`: The class name of the fragment to instantiate. <br />                                                                                                                                                   |
| `args`    | `Bundle`: Bundle of arguments to supply to the fragment, which it can retrieve with [getArguments()](https://developer.android.com/reference/android/support/v4/app/Fragment#getArguments()). May be null. <br /> |

|                                                           Returns                                                            ||
|-------------------------------------------------------------------------------------|-----------------------------------------|
| [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment) | Returns a new fragment instance. <br /> |

|                                                                             Throws                                                                             ||
|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `InstantiationException` | If there is a failure in instantiating the given fragment class. This is a runtime exception; it is not normally expected to happen. |

### isAdded

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isAdded ()
```

Return true if the fragment is currently added to its activity.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isDetached

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isDetached ()
```

Return true if the fragment has been explicitly detached from the UI.
That is, [FragmentTransaction.detach(Fragment)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#detach(android.support.v4.app.Fragment)) has been used on it.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isHidden

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isHidden ()
```

Return true if the fragment has been hidden. By default fragments
are shown. You can find out about changes to this state with
[onHiddenChanged(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#onHiddenChanged(boolean)). Note that the hidden state is orthogonal
to other states -- that is, to be visible to the user, a fragment
must be both started and not hidden.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isInLayout

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isInLayout ()
```

Return true if the layout is included as part of an activity view
hierarchy via the \<fragment\> tag. This will always be true when
fragments are created through the \<fragment\> tag, *except*
in the case where an old fragment is restored from a previous state and
it does not appear in the layout of the current state.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isRemoving

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRemoving ()
```

Return true if this fragment is currently being removed from its
activity. This is *not* whether its activity is finishing, but
rather whether it is in the process of being removed from its activity.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isResumed

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isResumed ()
```

Return true if the fragment is in the resumed state. This is true
for the duration of [onResume()](https://developer.android.com/reference/android/support/v4/app/Fragment#onResume()) and [onPause()](https://developer.android.com/reference/android/support/v4/app/Fragment#onPause()) as well.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isStateSaved

added in [version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isStateSaved ()
```

Returns true if this fragment is added and its state has already been saved
by its host. Any operations that would change saved state should not be performed
if this method returns true, and some operations such as [setArguments(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#setArguments(android.os.Bundle))
will fail.

<br />

|                                      Returns                                       ||
|-----------|-------------------------------------------------------------------------|
| `boolean` | true if this fragment's state has already been saved by its host <br /> |

### isVisible

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isVisible ()
```

Return true if the fragment is currently visible to the user. This means
it: (1) has been added, (2) has its view attached to the window, and
(3) is not hidden.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### onActivityCreated

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onActivityCreated (Bundle savedInstanceState)
```

Called when the fragment's activity has been created and this
fragment's view hierarchy instantiated. It can be used to do final
initialization once these pieces are in place, such as retrieving
views or restoring state. It is also useful for fragments that use
[setRetainInstance(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#setRetainInstance(boolean)) to retain their instance,
as this callback tells the fragment when it is fully associated with
the new activity instance. This is called after [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))
and before [onViewStateRestored(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onViewStateRestored(android.os.Bundle)).

<br />

|                                                         Parameters                                                         ||
|----------------------|------------------------------------------------------------------------------------------------------|
| `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br /> |

### onActivityResult

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onActivityResult (int requestCode, 
                int resultCode, 
                Intent data)
```

Receive the result from a previous call to
[startActivityForResult(Intent, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#startActivityForResult(android.content.Intent, int)). This follows the
related Activity API as described there in
[onActivityResult(int, int, Intent)](https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)).

<br />

|                                                                         Parameters                                                                         ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `requestCode` | `int`: The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from. <br /> |
| `resultCode`  | `int`: The integer result code returned by the child activity through its setResult(). <br />                                               |
| `data`        | `Intent`: An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). <br />                   |

### onAttach

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAttach (Activity activity)
```


**This method was deprecated
in API level 24.1.0.**   

See [onAttach(Context)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.content.Context)).

Called when a fragment is first attached to its activity.
[onCreate(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)) will be called after this.

<br />

|          Parameters           ||
|------------|-------------------|
| `activity` | `Activity` <br /> |

### onAttach

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAttach (Context context)
```

Called when a fragment is first attached to its context.
[onCreate(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)) will be called after this.

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |

### onAttachFragment

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAttachFragment (Fragment childFragment)
```

Called when a fragment is attached as a child of this fragment.

This is called after the attached fragment's `onAttach` and before
the attached fragment's `onCreate` if the fragment has not yet had a previous
call to `onCreate`.

<br />

<br />

|                            Parameters                             ||
|-----------------|--------------------------------------------------|
| `childFragment` | `Fragment`: child fragment being attached <br /> |

### onConfigurationChanged

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onConfigurationChanged (Configuration newConfig)
```

<br />

<br />

|             Parameters              ||
|-------------|------------------------|
| `newConfig` | `Configuration` <br /> |

### onContextItemSelected

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean onContextItemSelected (MenuItem item)
```

This hook is called whenever an item in a context menu is selected. The
default implementation simply returns false to have the normal processing
happen (calling the item's Runnable or sending a message to its Handler
as appropriate). You can use this method for any items for which you
would like to do processing without those other facilities.


Use [getMenuInfo()](https://developer.android.com/reference/android/view/MenuItem.html#getMenuInfo()) to get extra information set by the
View that added this menu item.


Derived classes should call through to the base class for it to perform
the default menu handling.

<br />

|                             Parameters                              ||
|--------|-------------------------------------------------------------|
| `item` | `MenuItem`: The context menu item that was selected. <br /> |

|                                                       Returns                                                       ||
|-----------|----------------------------------------------------------------------------------------------------------|
| `boolean` | boolean Return false to allow normal context menu processing to proceed, true to consume it here. <br /> |

### onCreate

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

Called to do initial creation of a fragment. This is called after
[onAttach(Activity)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.app.Activity)) and before
[onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/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, see [onActivityCreated(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle)).

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

<br />

<br />

|                                                         Parameters                                                         ||
|----------------------|------------------------------------------------------------------------------------------------------|
| `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br /> |

### onCreateAnimation

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Animation onCreateAnimation (int transit,
                boolean enter, 
                int nextAnim)
```

Called when a fragment loads an animation. Note that if
[setCustomAnimations(int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int)) was called with
[Animator](https://developer.android.com/reference/android/animation/Animator.html) resources instead of [Animation](https://developer.android.com/reference/android/view/animation/Animation.html) resources, `nextAnim`
will be an animator resource.

<br />

|                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                      ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transit`  | `int`: The value set in [setTransition(int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setTransition(int)) or 0 if not set. <br />                                                                                                                                                                                                                                                             |
| `enter`    | `boolean`: `true` when the fragment is added/attached/shown or `false` when the fragment is removed/detached/hidden. <br />                                                                                                                                                                                                                                                                                                             |
| `nextAnim` | `int`: The resource set in [setCustomAnimations(int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int)), [setCustomAnimations(int, int, int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int, int, int)), or 0 if neither was called. The value will depend on the current operation. <br /> |

|                                              Returns                                               ||
|--------------------------------------------------------------------------------------------|--------|
| [Animation](https://developer.android.com/reference/android/view/animation/Animation.html) | <br /> |

### onCreateAnimator

added in [version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Animator onCreateAnimator (int transit,
                boolean enter, 
                int nextAnim)
```

Called when a fragment loads an animator. This will be called when
[onCreateAnimation(int, boolean, int)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateAnimation(int, boolean, int)) returns null. Note that if
[setCustomAnimations(int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int)) was called with
[Animation](https://developer.android.com/reference/android/view/animation/Animation.html) resources instead of [Animator](https://developer.android.com/reference/android/animation/Animator.html) resources, `nextAnim`
will be an animation resource.

<br />

|                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                      ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transit`  | `int`: The value set in [setTransition(int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setTransition(int)) or 0 if not set. <br />                                                                                                                                                                                                                                                             |
| `enter`    | `boolean`: `true` when the fragment is added/attached/shown or `false` when the fragment is removed/detached/hidden. <br />                                                                                                                                                                                                                                                                                                             |
| `nextAnim` | `int`: The resource set in [setCustomAnimations(int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int)), [setCustomAnimations(int, int, int, int)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setCustomAnimations(int, int, int, int)), or 0 if neither was called. The value will depend on the current operation. <br /> |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [Animator](https://developer.android.com/reference/android/animation/Animator.html) | <br /> |

### onCreateContextMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onCreateContextMenu (ContextMenu menu,
                View v,
                ContextMenu.ContextMenuInfo menuInfo)
```

Called when a context menu for the `view` is about to be shown.
Unlike [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater)), this will be called every
time the context menu is about to be shown and should be populated for
the view (or item inside the view for [AdapterView](https://developer.android.com/reference/android/widget/AdapterView.html) subclasses,
this can be found in the `menuInfo`)).


Use [onContextItemSelected(android.view.MenuItem)](https://developer.android.com/reference/android/support/v4/app/Fragment#onContextItemSelected(android.view.MenuItem)) to know when an
item has been selected.


The default implementation calls up to
[Activity.onCreateContextMenu](https://developer.android.com/reference/android/app/Activity.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)), though
you can not call this implementation if you don't want that behavior.


It is not safe to hold onto the context menu after this method returns.

<br />

|                    Parameters                    ||
|------------|--------------------------------------|
| `menu`     | `ContextMenu` <br />                 |
| `v`        | `View` <br />                        |
| `menuInfo` | `ContextMenu.ContextMenuInfo` <br /> |

### onCreateOptionsMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onCreateOptionsMenu (Menu menu,
                MenuInflater inflater)
```

Initialize the contents of the Fragment host's standard options menu. You
should place your menu items in to <var translate="no">menu</var>. For this method
to be called, you must have first called [setHasOptionsMenu(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#setHasOptionsMenu(boolean)). See
[Activity.onCreateOptionsMenu](https://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu))
for more information.

<br />

|                                 Parameters                                 ||
|------------|----------------------------------------------------------------|
| `menu`     | `Menu`: The options menu in which you place your items. <br /> |
| `inflater` | `MenuInflater` <br />                                          |

**See also:**

- [setHasOptionsMenu(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#setHasOptionsMenu(boolean))
- [onPrepareOptionsMenu(Menu)](https://developer.android.com/reference/android/support/v4/app/Fragment#onPrepareOptionsMenu(android.view.Menu))
- [onOptionsItemSelected(MenuItem)](https://developer.android.com/reference/android/support/v4/app/Fragment#onOptionsItemSelected(android.view.MenuItem))  

### onCreateView

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
View onCreateView (LayoutInflater inflater,
                ViewGroup container,
                Bundle savedInstanceState)
```

Called to have the fragment instantiate its user interface view.
This is optional, and non-graphical fragments can return null (which
is the default implementation). This will be called between
[onCreate(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)) and [onActivityCreated(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle)).

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

<br />

|                                                                                                                Parameters                                                                                                                ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `inflater`           | `LayoutInflater`: The LayoutInflater object that can be used to inflate any views in the fragment, <br />                                                                                                          |
| `container`          | `ViewGroup`: 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. <br /> |
| `savedInstanceState` | `Bundle`: If non-null, this fragment is being re-constructed from a previous saved state as given here. <br />                                                                                                     |

|                                                            Returns                                                             ||
|------------------------------------------------------------------------|--------------------------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | Return the View for the fragment's UI, or null. <br /> |

### onDestroy

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDestroy ()
```

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

<br />

### onDestroyOptionsMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDestroyOptionsMenu ()
```

Called when this fragment's option menu items are no longer being
included in the overall options menu. Receiving this call means that
the menu needed to be rebuilt, but this fragment's items were not
included in the newly built menu (its [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))
was not called).

<br />

### onDestroyView

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDestroyView ()
```

Called when the view previously created by [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/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 [onStop()](https://developer.android.com/reference/android/support/v4/app/Fragment#onStop()) and before [onDestroy()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroy()). It is called
*regardless* of whether [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/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.

<br />

### onDetach

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDetach ()
```

Called when the fragment is no longer attached to its activity. This
is called after [onDestroy()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroy()).

<br />

### onGetLayoutInflater

added in [version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
LayoutInflater onGetLayoutInflater (Bundle savedInstanceState)
```

Returns the LayoutInflater used to inflate Views of this Fragment. The default
implementation will throw an exception if the Fragment is not attached.

<br />

|                                                         Parameters                                                         ||
|----------------------|------------------------------------------------------------------------------------------------------|
| `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br /> |

|                                                                            Returns                                                                            ||
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html) | The LayoutInflater used to inflate Views of this Fragment. <br /> |

### onHiddenChanged

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onHiddenChanged (boolean hidden)
```

Called when the hidden state (as returned by [isHidden()](https://developer.android.com/reference/android/support/v4/app/Fragment#isHidden()) of
the fragment has changed. Fragments start out not hidden; this will
be called whenever the fragment changes state from that.

<br />

|                                    Parameters                                    ||
|----------|------------------------------------------------------------------------|
| `hidden` | `boolean`: True if the fragment is now hidden, false otherwise. <br /> |

### onInflate

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onInflate (Activity activity,
                AttributeSet attrs,
                Bundle savedInstanceState)
```


**This method was deprecated
in API level 24.1.0.**   

See [onInflate(Context, AttributeSet, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle)).

Called when a fragment is being created as part of a view layout
inflation, typically from setting the content view of an activity.

<br />

|                 Parameters                  ||
|----------------------|-----------------------|
| `activity`           | `Activity` <br />     |
| `attrs`              | `AttributeSet` <br /> |
| `savedInstanceState` | `Bundle` <br />       |

### onInflate

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onInflate (Context context,
                AttributeSet attrs,
                Bundle savedInstanceState)
```

Called when a fragment is being created as part of a view layout
inflation, typically from setting the content view of an activity. This
may be called immediately after the fragment is created from a tag in a layout file. Note this is *before* the fragment's [onAttach(Activity)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.app.Activity)) has been called; all you should do here is parse the attributes and save them away.

This is called every time the fragment is inflated, even if it is
being inflated into a new instance with saved state. It typically makes
sense to re-parse the parameters each time, to allow them to change with
different configurations.

Here is a typical implementation of a fragment that can take parameters
both through attributes supplied here as well from [getArguments()](https://developer.android.com/reference/android/support/v4/app/Fragment#getArguments()):  

```
public static class MyFragment extends Fragment {
    CharSequence mLabel;

    /**
     * Create a new instance of MyFragment that will be initialized
     * with the given arguments.
     */
    static MyFragment newInstance(CharSequence label) {
        MyFragment f = new MyFragment();
        Bundle b = new Bundle();
        b.putCharSequence("label", label);
        f.setArguments(b);
        return f;
    }

    /**
     * Parse attributes during inflation from a view hierarchy into the
     * arguments we handle.
     */
    @Override
    public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
        super.onInflate(context, attrs, savedInstanceState);

        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.FragmentArguments);
        mLabel = a.getText(R.styleable.FragmentArguments_android_label);
        a.recycle();
    }

    /**
     * During creation, if arguments have been supplied to the fragment
     * then parse those out.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Bundle args = getArguments();
        if (args != null) {
            CharSequence label = args.getCharSequence("label");
            if (label != null) {
                mLabel = label;
            }
        }
    }

    /**
     * Create the view for this fragment, using the arguments given to it.
     */
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.hello_world, container, false);
        View tv = v.findViewById(R.id.text);
        ((TextView)tv).setText(mLabel != null ? mLabel : "(no label)");
        ViewCompat.setBackground(
                tv, ContextCompat.getDrawable(getContext(), android.R.drawable.gallery_thumb));
        return v;
    }
}
```

Note that parsing the XML attributes uses a "styleable" resource. The
declaration for the styleable used here is:  

```
<declare-styleable name="FragmentArguments">
    <attr name="android:label" />
</declare-styleable>
```

The fragment can then be declared within its activity's content layout
through a tag like this:  

```
<fragment class="com.example.android.supportv4.app.FragmentArgumentsSupport$MyFragment"
        android:id="@+id/embedded"
        android:layout_width="0px" android:layout_height="wrap_content"
        android:layout_weight="1"
        android:label="@string/fragment_arguments_embedded" />
```

This fragment can also be created dynamically from arguments given
at runtime in the arguments Bundle; here is an example of doing so at
creation of the containing activity:  

```
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_arguments_support);

    if (savedInstanceState == null) {
        // First-time init; create fragment to embed in activity.
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        Fragment newFragment = MyFragment.newInstance("From Arguments");
        ft.add(R.id.created, newFragment);
        ft.commit();
    }
}
```

<br />

<br />

|                                                         Parameters                                                         ||
|----------------------|------------------------------------------------------------------------------------------------------|
| `context`            | `Context`: The Activity that is inflating this fragment. <br />                                      |
| `attrs`              | `AttributeSet`: The attributes at the tag where the fragment is being created. <br />                |
| `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br /> |

### onLowMemory

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onLowMemory ()
```

<br />

<br />

### onMultiWindowModeChanged

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onMultiWindowModeChanged (boolean isInMultiWindowMode)
```

Called when the Fragment's activity changes from fullscreen mode to multi-window mode and
visa-versa. This is generally tied to [onMultiWindowModeChanged(boolean)](https://developer.android.com/reference/android/app/Activity.html#onMultiWindowModeChanged(boolean)) of the
containing Activity.

<br />

|                                       Parameters                                       ||
|-----------------------|-----------------------------------------------------------------|
| `isInMultiWindowMode` | `boolean`: True if the activity is in multi-window mode. <br /> |

### onOptionsItemSelected

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean onOptionsItemSelected (MenuItem item)
```

This hook is called whenever an item in your options menu is selected.
The default implementation simply returns false to have the normal
processing happen (calling the item's Runnable or sending a message to
its Handler as appropriate). You can use this method for any items
for which you would like to do processing without those other
facilities.

Derived classes should call through to the base class for it to
perform the default menu handling.

<br />

|                         Parameters                          ||
|--------|-----------------------------------------------------|
| `item` | `MenuItem`: The menu item that was selected. <br /> |

|                                                   Returns                                                   ||
|-----------|--------------------------------------------------------------------------------------------------|
| `boolean` | boolean Return false to allow normal menu processing to proceed, true to consume it here. <br /> |

**See also:**

- [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))  

### onOptionsMenuClosed

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onOptionsMenuClosed (Menu menu)
```

This hook is called whenever the options menu is being closed (either by the user canceling
the menu with the back/menu button, or when an item is selected).

<br />

|                                              Parameters                                              ||
|--------|----------------------------------------------------------------------------------------------|
| `menu` | `Menu`: The options menu as last shown or first initialized by onCreateOptionsMenu(). <br /> |

### onPause

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onPause ()
```

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

<br />

### onPictureInPictureModeChanged

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onPictureInPictureModeChanged (boolean isInPictureInPictureMode)
```

Called by the system when the activity changes to and from picture-in-picture mode. This is
generally tied to [onPictureInPictureModeChanged(boolean)](https://developer.android.com/reference/android/app/Activity.html#onPictureInPictureModeChanged(boolean)) of the containing Activity.

<br />

|                                            Parameters                                             ||
|----------------------------|-----------------------------------------------------------------------|
| `isInPictureInPictureMode` | `boolean`: True if the activity is in picture-in-picture mode. <br /> |

### onPrepareOptionsMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onPrepareOptionsMenu (Menu menu)
```

Prepare the Fragment host's standard options menu to be displayed. This is
called right before the menu is shown, every time it is shown. You can
use this method to efficiently enable/disable items or otherwise
dynamically modify the contents. See
[Activity.onPrepareOptionsMenu](https://developer.android.com/reference/android/app/Activity.html#onPrepareOptionsMenu(android.view.Menu))
for more information.

<br />

|                                              Parameters                                              ||
|--------|----------------------------------------------------------------------------------------------|
| `menu` | `Menu`: The options menu as last shown or first initialized by onCreateOptionsMenu(). <br /> |

**See also:**

- [setHasOptionsMenu(boolean)](https://developer.android.com/reference/android/support/v4/app/Fragment#setHasOptionsMenu(boolean))
- [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))  

### onRequestPermissionsResult

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onRequestPermissionsResult (int requestCode, 
                String[] permissions, 
                int[] grantResults)
```

Callback for the result from requesting permissions. This method
is invoked for every call on [requestPermissions(String[], int)](https://developer.android.com/reference/android/support/v4/app/Fragment#requestPermissions(java.lang.String[], int)).


**Note:** It is possible that the permissions request interaction
with the user is interrupted. In this case you will receive empty permissions
and results arrays which should be treated as a cancellation.

<br />

<br />

|                                                                                                                                                                           Parameters                                                                                                                                                                            ||
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `requestCode`  | `int`: The request code passed in [requestPermissions(String[], int)](https://developer.android.com/reference/android/support/v4/app/Fragment#requestPermissions(java.lang.String[], int)). <br />                                                                                                                                              |
| `permissions`  | `String`: The requested permissions. Never null. <br />                                                                                                                                                                                                                                                                                         |
| `grantResults` | `int`: The grant results for the corresponding permissions which is either [PERMISSION_GRANTED](https://developer.android.com/reference/android/content/pm/PackageManager.html#PERMISSION_GRANTED) or [PERMISSION_DENIED](https://developer.android.com/reference/android/content/pm/PackageManager.html#PERMISSION_DENIED). Never null. <br /> |

**See also:**

- [requestPermissions(String[], int)](https://developer.android.com/reference/android/support/v4/app/Fragment#requestPermissions(java.lang.String[], int))  

### onResume

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onResume ()
```

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

<br />

### onSaveInstanceState

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onSaveInstanceState (Bundle outState)
```

Called to ask the fragment to save its current dynamic state, so it
can later be reconstructed in a new instance of its process is
restarted. If a new instance of the fragment later needs to be
created, the data you place in the Bundle here will be available
in the Bundle given to [onCreate(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)),
[onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)), and
[onActivityCreated(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle)).

This corresponds to [Activity.onSaveInstanceState(Bundle)](https://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)) and most of the discussion there
applies here as well. Note however: *this method may be called
at any time before [onDestroy()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroy())*. There are many situations
where a fragment may be mostly torn down (such as when placed on the
back stack with no UI showing), but its state will not be saved until
its owning activity actually needs to save its state.

<br />

|                               Parameters                                ||
|------------|-------------------------------------------------------------|
| `outState` | `Bundle`: Bundle in which to place your saved state. <br /> |

### onStart

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onStart ()
```

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

<br />

### onStop

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onStop ()
```

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

<br />

### onViewCreated

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onViewCreated (View view,
                Bundle savedInstanceState)
```

Called immediately after [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/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.

<br />

|                                                                                                                                 Parameters                                                                                                                                 ||
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `view`               | `View`: The View returned by [onCreateView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)). <br /> |
| `savedInstanceState` | `Bundle`: If non-null, this fragment is being re-constructed from a previous saved state as given here. <br />                                                                                                                                       |

### onViewStateRestored

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onViewStateRestored (Bundle savedInstanceState)
```

Called when all saved state has been restored into the view hierarchy
of the fragment. This can be used to do initialization based on saved
state that you are letting the view hierarchy track itself, such as
whether check box widgets are currently checked. This is called
after [onActivityCreated(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle)) and before
[onStart()](https://developer.android.com/reference/android/support/v4/app/Fragment#onStart()).

<br />

|                                                         Parameters                                                         ||
|----------------------|------------------------------------------------------------------------------------------------------|
| `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br /> |

### postponeEnterTransition

added in [version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void postponeEnterTransition ()
```

Postpone the entering Fragment transition until [startPostponedEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#startPostponedEnterTransition())
or [executePendingTransactions()](https://developer.android.com/reference/android/support/v4/app/FragmentManager#executePendingTransactions()) has been called.


This method gives the Fragment the ability to delay Fragment animations
until all data is loaded. Until then, the added, shown, and
attached Fragments will be INVISIBLE and removed, hidden, and detached Fragments won't
be have their Views removed. The transaction runs when all postponed added Fragments in the
transaction have called [startPostponedEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#startPostponedEnterTransition()).


This method should be called before being added to the FragmentTransaction or
in [{@link #onAttach(Context)}, or
{@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)).
[startPostponedEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#startPostponedEnterTransition()) must be called to allow the Fragment to
start the transitions.


When a FragmentTransaction is started that may affect a postponed FragmentTransaction,
based on which containers are in their operations, the postponed FragmentTransaction
will have its start triggered. The early triggering may result in faulty or nonexistent
animations in the postponed transaction. FragmentTransactions that operate only on
independent containers will not interfere with each other's postponement.


Calling postponeEnterTransition on Fragments with a null View will not postpone the
transition. Likewise, postponement only works if
[FragmentTransaction reordering](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setReorderingAllowed(boolean)) is
enabled.

<br />

**See also:**

- [postponeEnterTransition()](https://developer.android.com/reference/android/app/Activity.html#postponeEnterTransition())
- [setReorderingAllowed(boolean)](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction#setReorderingAllowed(boolean))  

### registerForContextMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void registerForContextMenu (View view)
```

Registers a context menu to be shown for the given view (multiple views
can show the context menu). This method will set the
[View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html) on the view to this fragment, so
[onCreateContextMenu(ContextMenu, View, ContextMenuInfo)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)) will be
called when it is time to show the context menu.

<br />

|                            Parameters                            ||
|--------|----------------------------------------------------------|
| `view` | `View`: The view that should show a context menu. <br /> |

**See also:**

- [unregisterForContextMenu(View)](https://developer.android.com/reference/android/support/v4/app/Fragment#unregisterForContextMenu(android.view.View))  

### requestPermissions

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void requestPermissions (String[] permissions, 
                int requestCode)
```

Requests permissions to be granted to this application. These permissions
must be requested in your manifest, they should not be granted to your app,
and they should have protection level [#PROTECTION_DANGEROUS dangerous](https://developer.android.com/reference/android/content/pm/PermissionInfo.html), regardless whether they are declared by
the platform or a third-party app.


Normal permissions [PROTECTION_NORMAL](https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_NORMAL)
are granted at install time if requested in the manifest. Signature permissions
[PROTECTION_SIGNATURE](https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_SIGNATURE) are granted at
install time if requested in the manifest and the signature of your app matches
the signature of the app declaring the permissions.


If your app does not have the requested permissions the user will be presented
with UI for accepting them. After the user has accepted or rejected the
requested permissions you will receive a callback on [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[])) reporting whether the
permissions were granted or not.


Note that requesting a permission does not guarantee it will be granted and
your app should be able to run without having this permission.


This method may start an activity allowing the user to choose which permissions
to grant and which to reject. Hence, you should be prepared that your activity
may be paused and resumed. Further, granting some permissions may require
a restart of you application. In such a case, the system will recreate the
activity stack before delivering the result to [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[])).


When checking whether you have a permission you should use [checkSelfPermission(String)](https://developer.android.com/reference/android/content/Context.html#checkSelfPermission(java.lang.String)).


Calling this API for permissions already granted to your app would show UI
to the user to decided whether the app can still hold these permissions. This
can be useful if the way your app uses the data guarded by the permissions
changes significantly.


A sample permissions request looks like this:

    `
     private void showContacts() {
         if (getActivity().checkSelfPermission(Manifest.permission.READ_CONTACTS)
                 != PackageManager.PERMISSION_GRANTED) {
             requestPermissions(new String[]{Manifest.permission.READ_CONTACTS},
                     PERMISSIONS_REQUEST_READ_CONTACTS);
         } else {
             doShowContacts();
         }
     }

     @Override
     public void onRequestPermissionsResult(int requestCode, String[] permissions,
             int[] grantResults) {
         if (requestCode == PERMISSIONS_REQUEST_READ_CONTACTS
                 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
             doShowContacts();
         }
     }
     `

<br />

<br />

<br />

|                                                                                                                                        Parameters                                                                                                                                         ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `permissions` | `String`: The requested permissions. <br />                                                                                                                                                                                                                                |
| `requestCode` | `int`: Application specific request code to match with a result reported to [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[])). <br /> |

**See also:**

- [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[]))
- [checkSelfPermission(String)](https://developer.android.com/reference/android/content/Context.html#checkSelfPermission(java.lang.String))  

### requireActivity

added in [version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FragmentActivity requireActivity ()
```

Return the [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) this fragment is currently associated with.

<br />

|                                                   Returns                                                   ||
|-----------------------------------------------------------------------------------------------------|--------|
| [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity) | <br /> |

|                                                   Throws                                                    ||
|-------------------------|------------------------------------------------------------------------------------|
| `IllegalStateException` | if not currently associated with an activity or if associated only with a context. |

**See also:**

- [getActivity()](https://developer.android.com/reference/android/support/v4/app/Fragment#getActivity())  

### requireContext

added in [version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Context requireContext ()
```

Return the [Context](https://developer.android.com/reference/android/content/Context.html) this fragment is currently associated with.

<br />

|                                         Returns                                         ||
|---------------------------------------------------------------------------------|--------|
| [Context](https://developer.android.com/reference/android/content/Context.html) | <br /> |

|                                Throws                                ||
|-------------------------|---------------------------------------------|
| `IllegalStateException` | if not currently associated with a context. |

**See also:**

- [getContext()](https://developer.android.com/reference/android/support/v4/app/Fragment#getContext())  

### requireFragmentManager

added in [version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FragmentManager requireFragmentManager ()
```

Return the FragmentManager for interacting with fragments associated
with this fragment's activity. Note that this will available slightly
before [getActivity()](https://developer.android.com/reference/android/support/v4/app/Fragment#getActivity()), during the time from when the fragment is
placed in a [FragmentTransaction](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction) until it is committed and
attached to its activity.

If this Fragment is a child of another Fragment, the FragmentManager
returned here will be the parent's [getChildFragmentManager()](https://developer.android.com/reference/android/support/v4/app/Fragment#getChildFragmentManager()).

<br />

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager) | <br /> |

|                                 Throws                                 ||
|-------------------------|-----------------------------------------------|
| `IllegalStateException` | if not associated with a transaction or host. |

**See also:**

- [getFragmentManager()](https://developer.android.com/reference/android/support/v4/app/Fragment#getFragmentManager())  

### requireHost

added in [version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object requireHost ()
```

Return the host object of this fragment.

<br />

|     Returns      ||
|----------|--------|
| `Object` | <br /> |

|                              Throws                               ||
|-------------------------|------------------------------------------|
| `IllegalStateException` | if not currently associated with a host. |

**See also:**

- [getHost()](https://developer.android.com/reference/android/support/v4/app/Fragment#getHost())  

### setAllowEnterTransitionOverlap

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setAllowEnterTransitionOverlap (boolean allow)
```

Sets whether the the exit transition and enter transition overlap or not.
When true, the enter transition will start as soon as possible. When false, the
enter transition will wait until the exit transition completes before starting.

<br />

|                                                              Parameters                                                              ||
|---------|-----------------------------------------------------------------------------------------------------------------------------|
| `allow` | `boolean`: true to start the enter transition when possible or false to wait until the exiting transition completes. <br /> |

### setAllowReturnTransitionOverlap

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setAllowReturnTransitionOverlap (boolean allow)
```

Sets whether the the return transition and reenter transition overlap or not.
When true, the reenter transition will start as soon as possible. When false, the
reenter transition will wait until the return transition completes before starting.

<br />

|                                                              Parameters                                                               ||
|---------|------------------------------------------------------------------------------------------------------------------------------|
| `allow` | `boolean`: true to start the reenter transition when possible or false to wait until the return transition completes. <br /> |

### setArguments

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setArguments (Bundle args)
```

Supply the construction arguments for this fragment.
The arguments supplied here will be retained across fragment destroy and
creation.

This method cannot be called if the fragment is added to a FragmentManager and
if [isStateSaved()](https://developer.android.com/reference/android/support/v4/app/Fragment#isStateSaved()) would return true.

<br />

<br />

|       Parameters        ||
|--------|-----------------|
| `args` | `Bundle` <br /> |

### setEnterSharedElementCallback

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setEnterSharedElementCallback (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.

<br />

|                                                                         Parameters                                                                          ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `callback` | `SharedElementCallback`: Used to manipulate the shared element transitions on this Fragment when added not as a pop from the back stack. <br /> |

### setEnterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setEnterTransition (Object transition)
```

Sets the Transition that will be used to move Views into the initial scene. The entering
Views will be those that are regular Views or ViewGroups that have
[isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as entering is governed by changing visibility from
[INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE) to [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE). If `transition` is null,
entering Views will remain unaffected.

<br />

|                                         Parameters                                         ||
|--------------|------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use to move Views into the initial Scene. <br /> |

### setExitSharedElementCallback

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setExitSharedElementCallback (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.

<br />

|                                                                       Parameters                                                                        ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `callback` | `SharedElementCallback`: Used to manipulate the shared element transitions on this Fragment when added as a pop from the back stack. <br /> |

### setExitTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setExitTransition (Object 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.
The exiting Views will be those that are regular Views or ViewGroups that
have [isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as exiting is governed by changing visibility
from [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If transition is null, the views will
remain unaffected.

<br />

|                                                                                                                                                                                                       Parameters                                                                                                                                                                                                        ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use to move Views out of the Scene when the Fragment is being closed not due to popping the back stack. `transition` must be an [android.transition.Transition](https://developer.android.com/reference/android/transition/Transition.html) or [android.support.transition.Transition](https://developer.android.com/reference/android/support/transition/Transition). <br /> |

### setHasOptionsMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setHasOptionsMenu (boolean hasMenu)
```

Report that this fragment would like to participate in populating
the options menu by receiving a call to [onCreateOptionsMenu(Menu, MenuInflater)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))
and related methods.

<br />

|                                    Parameters                                    ||
|-----------|-----------------------------------------------------------------------|
| `hasMenu` | `boolean`: If true, the fragment has menu items to contribute. <br /> |

### setInitialSavedState

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setInitialSavedState (Fragment.SavedState state)
```

Set the initial saved state that this Fragment should restore itself
from when first being constructed, as returned by
[FragmentManager.saveFragmentInstanceState](https://developer.android.com/reference/android/support/v4/app/FragmentManager#saveFragmentInstanceState(android.support.v4.app.Fragment)).

<br />

|                                       Parameters                                       ||
|---------|-------------------------------------------------------------------------------|
| `state` | `Fragment.SavedState`: The state the fragment should be restored from. <br /> |

### setMenuVisibility

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setMenuVisibility (boolean menuVisible)
```

Set a hint for whether this fragment's menu should be visible. This
is useful if you know that a fragment has been placed in your view
hierarchy so that the user can not currently seen it, so any menu items
it has should also not be shown.

<br />

|                                                                     Parameters                                                                      ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `menuVisible` | `boolean`: The default is true, meaning the fragment's menu will be shown as usual. If false, the user will not see the menu. <br /> |

### setReenterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setReenterTransition (Object transition)
```

Sets the Transition that will be used to move Views in to the scene when returning due
to popping a back stack. The entering Views will be those that are regular Views
or ViewGroups that have [isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions
will extend [Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as exiting is governed by changing
visibility from [VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If transition is null,
the views will remain unaffected. If nothing is set, the default will be to use the same
transition as [setExitTransition(Object)](https://developer.android.com/reference/android/support/v4/app/Fragment#setExitTransition(java.lang.Object)).

<br />

|                                                                                                                                                                                              Parameters                                                                                                                                                                                              ||
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use to move Views into the scene when reentering from a previously-started Activity. `transition` must be an [android.transition.Transition](https://developer.android.com/reference/android/transition/Transition.html) or [android.support.transition.Transition](https://developer.android.com/reference/android/support/transition/Transition). <br /> |

### setRetainInstance

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setRetainInstance (boolean retain)
```

Control whether a fragment instance is retained across Activity
re-creation (such as from a configuration change). This can only
be used with fragments not in the back stack. If set, the fragment
lifecycle will be slightly different when an activity is recreated:

- [onDestroy()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDestroy()) will not be called (but [onDetach()](https://developer.android.com/reference/android/support/v4/app/Fragment#onDetach()) still will be, because the fragment is being detached from its current activity).
- [onCreate(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onCreate(android.os.Bundle)) will not be called since the fragment is not being re-created.
- [onAttach(Activity)](https://developer.android.com/reference/android/support/v4/app/Fragment#onAttach(android.app.Activity)) and [onActivityCreated(Bundle)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityCreated(android.os.Bundle)) **will** still be called.

<br />

<br />

|         Parameters         ||
|----------|------------------|
| `retain` | `boolean` <br /> |

### setReturnTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setReturnTransition (Object 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. The exiting
Views will be those that are regular Views or ViewGroups that have
[isTransitionGroup()](https://developer.android.com/reference/android/view/ViewGroup.html#isTransitionGroup()) return true. Typical Transitions will extend
[Visibility](https://developer.android.com/reference/android/transition/Visibility.html) as entering is governed by changing visibility from
[VISIBLE](https://developer.android.com/reference/android/view/View.html#VISIBLE) to [INVISIBLE](https://developer.android.com/reference/android/view/View.html#INVISIBLE). If `transition` is null,
entering Views will remain unaffected. If nothing is set, the default will be to
use the same value as set in [setEnterTransition(Object)](https://developer.android.com/reference/android/support/v4/app/Fragment#setEnterTransition(java.lang.Object)).

<br />

|                                                                                                                                                                                         Parameters                                                                                                                                                                                          ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use to move Views out of the Scene when the Fragment is preparing to close. `transition` must be an [android.transition.Transition](https://developer.android.com/reference/android/transition/Transition.html) or [android.support.transition.Transition](https://developer.android.com/reference/android/support/transition/Transition). <br /> |

### setSharedElementEnterTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSharedElementEnterTransition (Object transition)
```

Sets the Transition that will be used for shared elements transferred into the content
Scene. Typical Transitions will affect size and location, such as
[ChangeBounds](https://developer.android.com/reference/android/transition/ChangeBounds.html). A null
value will cause transferred shared elements to blink to the final position.

<br />

|                                                                                                                                                                                 Parameters                                                                                                                                                                                  ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use for shared elements transferred into the content Scene. `transition` must be an [android.transition.Transition](https://developer.android.com/reference/android/transition/Transition.html) or [android.support.transition.Transition](https://developer.android.com/reference/android/support/transition/Transition). <br /> |

### setSharedElementReturnTransition

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSharedElementReturnTransition (Object transition)
```

Sets the Transition that will be used for shared elements transferred back during a
pop of the back stack. This Transition acts in the leaving Fragment.
Typical Transitions will affect size and location, such as
[ChangeBounds](https://developer.android.com/reference/android/transition/ChangeBounds.html). A null
value will cause transferred shared elements to blink to the final position.
If no value is set, the default will be to use the same value as
[setSharedElementEnterTransition(Object)](https://developer.android.com/reference/android/support/v4/app/Fragment#setSharedElementEnterTransition(java.lang.Object)).

<br />

|                                                                                                                                                                                  Parameters                                                                                                                                                                                   ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transition` | `Object`: The Transition to use for shared elements transferred out of the content Scene. `transition` must be an [android.transition.Transition](https://developer.android.com/reference/android/transition/Transition.html) or [android.support.transition.Transition](https://developer.android.com/reference/android/support/transition/Transition). <br /> |

### setTargetFragment

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setTargetFragment (Fragment fragment, 
                int requestCode)
```

Optional target for this fragment. This may be used, for example,
if this fragment is being started by another, and when done wants to
give a result back to the first. The target set here is retained
across instances via [FragmentManager.putFragment()](https://developer.android.com/reference/android/support/v4/app/FragmentManager#putFragment(android.os.Bundle, java.lang.String, android.support.v4.app.Fragment)).

<br />

|                                                                                                                                Parameters                                                                                                                                ||
|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fragment`    | `Fragment`: The fragment that is the target of this one. <br />                                                                                                                                                                                           |
| `requestCode` | `int`: Optional request code, for convenience if you are going to call back with [onActivityResult(int, int, Intent)](https://developer.android.com/reference/android/support/v4/app/Fragment#onActivityResult(int, int, android.content.Intent)). <br /> |

### setUserVisibleHint

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setUserVisibleHint (boolean isVisibleToUser)
```

Set a hint to the system about whether this fragment's UI is currently visible
to the user. This hint defaults to true and is persistent across fragment instance
state save and restore.

An app may set this to false to indicate that the fragment's UI is
scrolled out of visibility or is otherwise not directly visible to the user.
This may be used by the system to prioritize operations such as fragment lifecycle updates
or loader ordering behavior.

**Note:** This method may be called outside of the fragment lifecycle.
and thus has no ordering guarantees with regard to fragment lifecycle method calls.

<br />

<br />

|                                                           Parameters                                                            ||
|-------------------|--------------------------------------------------------------------------------------------------------------|
| `isVisibleToUser` | `boolean`: true if this fragment's UI is currently visible to the user (default), false if it is not. <br /> |

### shouldShowRequestPermissionRationale

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean shouldShowRequestPermissionRationale (String permission)
```

Gets whether you should show UI with rationale for requesting a permission.
You should do this only if you do not have the permission and the context in
which the permission is requested does not clearly communicate to the user
what would be the benefit from granting this permission.


For example, if you write a camera app, requesting the camera permission
would be expected by the user and no rationale for why it is requested is
needed. If however, the app needs location for tagging photos then a non-tech
savvy user may wonder how location is related to taking photos. In this case
you may choose to show UI with rationale of requesting this permission.

<br />

<br />

|                               Parameters                               ||
|--------------|----------------------------------------------------------|
| `permission` | `String`: A permission your app wants to request. <br /> |

|                             Returns                             ||
|-----------|------------------------------------------------------|
| `boolean` | Whether you can show permission rationale UI. <br /> |

**See also:**

- [checkSelfPermission(String)](https://developer.android.com/reference/android/content/Context.html#checkSelfPermission(java.lang.String))
- [requestPermissions(String[], int)](https://developer.android.com/reference/android/support/v4/app/Fragment#requestPermissions(java.lang.String[], int))
- [onRequestPermissionsResult(int, String[], int[])](https://developer.android.com/reference/android/support/v4/app/Fragment#onRequestPermissionsResult(int, java.lang.String[], int[]))  

### startActivity

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startActivity (Intent intent)
```

Call [startActivity(Intent)](https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)) from the fragment's
containing Activity.

<br />

|        Parameters         ||
|----------|-----------------|
| `intent` | `Intent` <br /> |

### startActivity

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startActivity (Intent intent,
                Bundle options)
```

Call [startActivity(Intent, Bundle)](https://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent, android.os.Bundle)) from the fragment's
containing Activity.

<br />

|         Parameters         ||
|-----------|-----------------|
| `intent`  | `Intent` <br /> |
| `options` | `Bundle` <br /> |

### startActivityForResult

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startActivityForResult (Intent intent,
                int requestCode)
```

Call [startActivityForResult(Intent, int)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)) from the fragment's
containing Activity.

<br />

|           Parameters           ||
|---------------|-----------------|
| `intent`      | `Intent` <br /> |
| `requestCode` | `int` <br />    |

### startActivityForResult

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startActivityForResult (Intent intent,
                int requestCode, 
                Bundle options)
```

Call [startActivityForResult(Intent, int, Bundle)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int, android.os.Bundle)) from the fragment's
containing Activity.

<br />

|           Parameters           ||
|---------------|-----------------|
| `intent`      | `Intent` <br /> |
| `requestCode` | `int` <br />    |
| `options`     | `Bundle` <br /> |

### startIntentSenderForResult

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startIntentSenderForResult (IntentSender intent,
                int requestCode, 
                Intent fillInIntent,
                int flagsMask, 
                int flagsValues, 
                int extraFlags, 
                Bundle options)
```

Call [startIntentSenderForResult(IntentSender, int, Intent, int, int, int, Bundle)](https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle)) from the fragment's containing Activity.

<br />

|              Parameters               ||
|----------------|-----------------------|
| `intent`       | `IntentSender` <br /> |
| `requestCode`  | `int` <br />          |
| `fillInIntent` | `Intent` <br />       |
| `flagsMask`    | `int` <br />          |
| `flagsValues`  | `int` <br />          |
| `extraFlags`   | `int` <br />          |
| `options`      | `Bundle` <br />       |

|                                                                Throws                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) |   |

### startPostponedEnterTransition

added in [version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startPostponedEnterTransition ()
```

Begin postponed transitions after [postponeEnterTransition()](https://developer.android.com/reference/android/support/v4/app/Fragment#postponeEnterTransition()) was called.
If postponeEnterTransition() was called, you must call startPostponedEnterTransition()
or [executePendingTransactions()](https://developer.android.com/reference/android/support/v4/app/FragmentManager#executePendingTransactions()) to complete the FragmentTransaction.
If postponement was interrupted with [executePendingTransactions()](https://developer.android.com/reference/android/support/v4/app/FragmentManager#executePendingTransactions()),
before `startPostponedEnterTransition()`, animations may not run or may execute
improperly.

<br />

**See also:**

- [startPostponedEnterTransition()](https://developer.android.com/reference/android/app/Activity.html#startPostponedEnterTransition())  

### toString

```
String toString ()
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### unregisterForContextMenu

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void unregisterForContextMenu (View view)
```

Prevents a context menu to be shown for the given view. This method will
remove the [View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html) on the view.

<br />

|                                Parameters                                ||
|--------|------------------------------------------------------------------|
| `view` | `View`: The view that should stop showing a context menu. <br /> |

**See also:**

- [registerForContextMenu(View)](https://developer.android.com/reference/android/support/v4/app/Fragment#registerForContextMenu(android.view.View))  
-

  ## Annotations

  - [NotificationCompat.Action.SemanticAction](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.SemanticAction)
-

  ## Interfaces

  - [ActionBarDrawerToggle.Delegate](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.Delegate)
  - [ActionBarDrawerToggle.DelegateProvider](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.DelegateProvider)
  - [ActivityCompat.OnRequestPermissionsResultCallback](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback)
  - [ActivityCompat.PermissionCompatDelegate](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.PermissionCompatDelegate)
  - [FragmentManager.BackStackEntry](https://developer.android.com/reference/android/support/v4/app/FragmentManager.BackStackEntry)
  - [FragmentManager.OnBackStackChangedListener](https://developer.android.com/reference/android/support/v4/app/FragmentManager.OnBackStackChangedListener)
  - [LoaderManager.LoaderCallbacks](https://developer.android.com/reference/android/support/v4/app/LoaderManager.LoaderCallbacks)
  - [NotificationCompat.Action.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Extender)
  - [NotificationCompat.Extender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Extender)
  - [SharedElementCallback.OnSharedElementsReadyListener](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback.OnSharedElementsReadyListener)
  - [TaskStackBuilder.SupportParentable](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder.SupportParentable)
-

  ## Classes

  - [ActionBarDrawerToggle](https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle)
  - [ActivityCompat](https://developer.android.com/reference/android/support/v4/app/ActivityCompat)
  - [ActivityManagerCompat](https://developer.android.com/reference/android/support/v4/app/ActivityManagerCompat)
  - [ActivityOptionsCompat](https://developer.android.com/reference/android/support/v4/app/ActivityOptionsCompat)
  - [AlarmManagerCompat](https://developer.android.com/reference/android/support/v4/app/AlarmManagerCompat)
  - [AppLaunchChecker](https://developer.android.com/reference/android/support/v4/app/AppLaunchChecker)
  - [AppOpsManagerCompat](https://developer.android.com/reference/android/support/v4/app/AppOpsManagerCompat)
  - [BundleCompat](https://developer.android.com/reference/android/support/v4/app/BundleCompat)
  - [DialogFragment](https://developer.android.com/reference/android/support/v4/app/DialogFragment)
  - [Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)
  - [Fragment.SavedState](https://developer.android.com/reference/android/support/v4/app/Fragment.SavedState)
  - [FragmentActivity](https://developer.android.com/reference/android/support/v4/app/FragmentActivity)
  - [FragmentContainer](https://developer.android.com/reference/android/support/v4/app/FragmentContainer)
  - [FragmentController](https://developer.android.com/reference/android/support/v4/app/FragmentController)
  - [FragmentHostCallback](https://developer.android.com/reference/android/support/v4/app/FragmentHostCallback)
  - [FragmentManager](https://developer.android.com/reference/android/support/v4/app/FragmentManager)
  - [FragmentManager.FragmentLifecycleCallbacks](https://developer.android.com/reference/android/support/v4/app/FragmentManager.FragmentLifecycleCallbacks)
  - [FragmentManagerNonConfig](https://developer.android.com/reference/android/support/v4/app/FragmentManagerNonConfig)
  - [FragmentPagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter)
  - [FragmentStatePagerAdapter](https://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter)
  - [FragmentTabHost](https://developer.android.com/reference/android/support/v4/app/FragmentTabHost)
  - [FragmentTransaction](https://developer.android.com/reference/android/support/v4/app/FragmentTransaction)
  - [FrameMetricsAggregator](https://developer.android.com/reference/android/support/v4/app/FrameMetricsAggregator)
  - [JobIntentService](https://developer.android.com/reference/android/support/v4/app/JobIntentService)
  - [ListFragment](https://developer.android.com/reference/android/support/v4/app/ListFragment)
  - [LoaderManager](https://developer.android.com/reference/android/support/v4/app/LoaderManager)
  - [NavUtils](https://developer.android.com/reference/android/support/v4/app/NavUtils)
  - [NotificationCompat](https://developer.android.com/reference/android/support/v4/app/NotificationCompat)
  - [NotificationCompat.Action](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action)
  - [NotificationCompat.Action.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.Builder)
  - [NotificationCompat.Action.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Action.WearableExtender)
  - [NotificationCompat.BigPictureStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigPictureStyle)
  - [NotificationCompat.BigTextStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.BigTextStyle)
  - [NotificationCompat.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder)
  - [NotificationCompat.CarExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender)
  - [NotificationCompat.CarExtender.UnreadConversation](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation)
  - [NotificationCompat.CarExtender.UnreadConversation.Builder](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.UnreadConversation.Builder)
  - [NotificationCompat.DecoratedCustomViewStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.DecoratedCustomViewStyle)
  - [NotificationCompat.InboxStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle)
  - [NotificationCompat.MessagingStyle](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle)
  - [NotificationCompat.MessagingStyle.Message](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle.Message)
  - [NotificationCompat.Style](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Style)
  - [NotificationCompat.WearableExtender](https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender)
  - [NotificationCompatExtras](https://developer.android.com/reference/android/support/v4/app/NotificationCompatExtras)
  - [NotificationCompatSideChannelService](https://developer.android.com/reference/android/support/v4/app/NotificationCompatSideChannelService)
  - [NotificationManagerCompat](https://developer.android.com/reference/android/support/v4/app/NotificationManagerCompat)
  - [RemoteInput](https://developer.android.com/reference/android/support/v4/app/RemoteInput)
  - [RemoteInput.Builder](https://developer.android.com/reference/android/support/v4/app/RemoteInput.Builder)
  - [ServiceCompat](https://developer.android.com/reference/android/support/v4/app/ServiceCompat)
  - [ShareCompat](https://developer.android.com/reference/android/support/v4/app/ShareCompat)
  - [ShareCompat.IntentBuilder](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentBuilder)
  - [ShareCompat.IntentReader](https://developer.android.com/reference/android/support/v4/app/ShareCompat.IntentReader)
  - [SharedElementCallback](https://developer.android.com/reference/android/support/v4/app/SharedElementCallback)
  - [TaskStackBuilder](https://developer.android.com/reference/android/support/v4/app/TaskStackBuilder)
-

  ## Exceptions

  - [Fragment.InstantiationException](https://developer.android.com/reference/android/support/v4/app/Fragment.InstantiationException)