# PreferenceFragmentCompat

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#nestedclasses)\|[XML Attrs](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#lattrs)\|[Constants](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#constants)\|[Ctors](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)  

# PreferenceFragmentCompat

| 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


abstract
class
PreferenceFragmentCompat
`  
`


``

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


``


implements

`[PreferenceManager.OnPreferenceTreeClickListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnPreferenceTreeClickListener)`,

`[PreferenceManager.OnDisplayPreferenceDialogListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnDisplayPreferenceDialogListener)`,

`[PreferenceManager.OnNavigateToScreenListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnNavigateToScreenListener)`,

`[DialogPreference.TargetFragment](https://developer.android.com/reference/android/support/v7/preference/DialogPreference.TargetFragment)`


`

|---|---|--------------------------------------------------------|
| java.lang.Object                                             |||
| ↳ | [android.support.v4.app.Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment) ||
|   | ↳ | android.support.v7.preference.PreferenceFragmentCompat |

<br />

*** ** * ** ***

Shows a hierarchy of[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)objects as lists. These preferences will automatically save to[SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html)as the user interacts with them. To retrieve an instance of[SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html)that the preference hierarchy in this fragment will use, call[getDefaultSharedPreferences(android.content.Context)](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager#getDefaultSharedPreferences(android.content.Context))with a context in the same package as this fragment.

Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a superclass) to deal with preferences in applications.

A[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)object should be at the top of the preference hierarchy. Furthermore, subsequent[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)in the hierarchy denote a screen break--that is the preferences contained within subsequent[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)should be shown on another screen. The preference framework handles this by calling[onNavigateToScreen(PreferenceScreen)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onNavigateToScreen(android.support.v7.preference.PreferenceScreen)).

The preference hierarchy can be formed in multiple ways:
- From an XML file specifying the hierarchy
- From different[Activities](https://developer.android.com/reference/android/app/Activity.html)that each specify its own preferences in an XML file via[Activity](https://developer.android.com/reference/android/app/Activity.html)meta-data
- From an object hierarchy rooted with[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)

  To inflate from XML, use the[addPreferencesFromResource(int)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#addPreferencesFromResource(int)). The root element should be a[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen). Subsequent elements can point to actual[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)subclasses. As mentioned above, subsequent[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)in the hierarchy will result in the screen break.

  To specify an object hierarchy rooted with[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen), use[setPreferenceScreen(PreferenceScreen)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setPreferenceScreen(android.support.v7.preference.PreferenceScreen)).

  As a convenience, this fragment implements a click listener for any preference in the current hierarchy, see[onPreferenceTreeClick(Preference)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onPreferenceTreeClick(android.support.v7.preference.Preference)).  

  ### Developer Guides

  For information about using`PreferenceFragment`, read the[Settings](https://developer.android.com/guide/topics/ui/settings)guide.

  ### Sample Code

  The following sample code shows a simple preference fragment that is populated from a resource. The resource it loads is:  

  ```
  <PreferenceScreen
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:title="@string/root_title">

      <Preference
          android:key="basic_preference"
          android:title="@string/title_basic_preference"
          android:summary="@string/summary_basic_preference" />

      <Preference
          android:key="stylish_preference"
          android:title="@string/title_stylish_preference"
          android:summary="@string/summary_stylish_preference" />

      <Preference
          android:key="preference_with_icon"
          android:title="Preference with icon"
          android:summary="This preference has an icon"
          android:icon="@android:drawable/ic_menu_camera" />

      <PreferenceCategory
          android:title="@string/inline_preferences">

          <CheckBoxPreference
              android:key="checkbox_preference"
              android:title="@string/title_checkbox_preference"
              android:summary="@string/summary_checkbox_preference" />

          <SwitchPreference
              android:key="switch_preference"
              android:title="Switch preference"
              android:summary="This is a switch" />

          <DropDownPreference
              android:key="dropdown_preference"
              android:title="@string/title_dropdown_preference"
              android:summary="@string/summary_dropdown_preference"
              android:entries="@array/entries_list_preference"
              android:entryValues="@array/entryvalues_list_preference" />

      </PreferenceCategory>

      <PreferenceCategory
          android:title="@string/dialog_based_preferences">

          <EditTextPreference
              android:key="edittext_preference"
              android:title="@string/title_edittext_preference"
              android:summary="@string/summary_edittext_preference"
              android:dialogTitle="@string/dialog_title_edittext_preference" />

          <ListPreference
              android:key="list_preference"
              android:title="@string/title_list_preference"
              android:summary="@string/summary_list_preference"
              android:entries="@array/entries_list_preference"
              android:entryValues="@array/entryvalues_list_preference"
              android:dialogTitle="@string/dialog_title_list_preference" />

          <MultiSelectListPreference
              android:key="multi_select_list_preference"
              android:title="@string/title_multi_list_preference"
              android:summary="@string/summary_multi_list_preference"
              android:entries="@array/entries_list_preference"
              android:entryValues="@array/entryvalues_list_preference"
              android:dialogTitle="@string/dialog_title_multi_list_preference" />

      </PreferenceCategory>

      <PreferenceCategory
          android:title="@string/launch_preferences">

          <!-- This PreferenceScreen tag serves as a screen break (similar to page break
               in word processing). Like for other preference types, we assign a key
               here so it is able to save and restore its instance state. -->
          <PreferenceScreen
              android:key="screen_preference"
              android:title="@string/title_screen_preference"
              android:summary="@string/summary_screen_preference">

              <!-- You can place more preferences here that will be shown on the next screen. -->

              <CheckBoxPreference
                  android:key="next_screen_checkbox_preference"
                  android:title="@string/title_next_screen_toggle_preference"
                  android:summary="@string/summary_next_screen_toggle_preference" />

          </PreferenceScreen>

          <PreferenceScreen
              android:title="@string/title_intent_preference"
              android:summary="@string/summary_intent_preference">

              <intent android:action="android.intent.action.VIEW"
                  android:data="http://www.android.com" />

          </PreferenceScreen>

      </PreferenceCategory>

      <PreferenceCategory
          android:title="@string/preference_attributes">

          <CheckBoxPreference
              android:key="parent_checkbox_preference"
              android:title="@string/title_parent_preference"
              android:summary="@string/summary_parent_preference" />

          <!-- The visual style of a child is defined by this styled theme attribute. -->
          <CheckBoxPreference
              android:key="child_checkbox_preference"
              android:dependency="parent_checkbox_preference"
              android:layout="?android:attr/preferenceLayoutChild"
              android:title="@string/title_child_preference"
              android:summary="@string/summary_child_preference" />

      </PreferenceCategory>

  </PreferenceScreen>
  ```

  The fragment implementation itself simply populates the preferences when created. Note that the preferences framework takes care of loading the current values out of the app preferences and writing them when changed:  

  ```
  public static class PrefsFragment extends PreferenceFragmentCompat {

      @Override
      public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
          // Load the preferences from an XML resource
          setPreferencesFromResource(R.xml.preferences, rootKey);
      }
  }
  ```

  <br />

  **See also:**
  - [Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)
  - [PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)

  ## Summary

  |                                                                                                                                                                              ### Nested classes                                                                                                                                                                              ||
  |--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | ` interface` | [PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback) <br />                                                                                                                                                          |
  | ` interface` | [PreferenceFragmentCompat.OnPreferenceStartFragmentCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartFragmentCallback) Interface that PreferenceFragment's containing activity should implement to be able to process preference items that wish to switch to a specified fragment.    |
  | ` interface` | [PreferenceFragmentCompat.OnPreferenceStartScreenCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartScreenCallback) Interface that PreferenceFragment's containing activity should implement to be able to process preference items that wish to switch to a new screen of preferences. |

  |                                                                                            ### XML attributes                                                                                             ||
  |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
  | [`PreferenceFragmentCompat_android_divider`](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#attr_PreferenceFragmentCompat_android_divider)             |   |
  | [`PreferenceFragmentCompat_android_dividerHeight`](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#attr_PreferenceFragmentCompat_android_dividerHeight) |   |

  |                                                                                                                                                           ### Constants                                                                                                                                                            ||
  |----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `String` | [ARG_PREFERENCE_ROOT](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#ARG_PREFERENCE_ROOT) Fragment argument used to specify the tag of the desired root[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)object. |

  |                                                                     ### Public constructors                                                                      ||
  |---------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
  | ` `[PreferenceFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#PreferenceFragmentCompat())`() ` |

  |                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                               ||
  |-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | ` void`                                                                                                                       | ` `[addPreferencesFromResource](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#addPreferencesFromResource(int))`(int preferencesResId) ` Inflates the given XML resource and adds the preference hierarchy to the current preference hierarchy.                                                                                                                                                                                                                                                                                                                                                                                |
  | ` `[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)                             | ` `[findPreference](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#findPreference(java.lang.CharSequence))`(CharSequence key) ` Finds a[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)based on its key.                                                                                                                                                                                                                                                                                                                                                                         |
  | ` final `[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)                       | ` `[getListView](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#getListView())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
  | ` `[PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager)               | ` `[getPreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#getPreferenceManager())`() ` Returns the[PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager)used by this fragment.                                                                                                                                                                                                                                                                                                                                                                            |
  | ` `[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)                 | ` `[getPreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#getPreferenceScreen())`() ` Gets the root of the preference hierarchy that this fragment is showing.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | ` void`                                                                                                                       | ` `[onActivityCreated](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#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`                                                                                                                       | ` `[onCreate](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreate(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Called to do initial creation of a fragment.                                                                                                                                                                                                                                                                                                                                                                                       |
  | ` `[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager) | ` `[onCreateLayoutManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreateLayoutManager())`() ` Called from[onCreateRecyclerView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreateRecyclerView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))to create the[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager)for the created[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView). |
  | ` abstract void`                                                                                                              | ` `[onCreatePreferences](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreatePreferences(android.os.Bundle, java.lang.String))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState, String rootKey) ` Called during[onCreate(Bundle)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreate(android.os.Bundle))to supply the preferences for this fragment.                                                                                                                                                                    |
  | ` `[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)                             | ` `[onCreateRecyclerView](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreateRecyclerView(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)` parent, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) ` Creates the[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)used to display the preferences.           |
  | ` `[View](https://developer.android.com/reference/android/view/View.html)                                                     | ` `[onCreateView](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#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`                                                                                                                       | ` `[onDestroyView](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#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`                                                                                                                       | ` `[onDisplayPreferenceDialog](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onDisplayPreferenceDialog(android.support.v7.preference.Preference))`(`[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)` preference) ` Called when a preference in the tree requests to display a dialog.                                                                                                                                                                                                                                                                                          |
  | ` void`                                                                                                                       | ` `[onNavigateToScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onNavigateToScreen(android.support.v7.preference.PreferenceScreen))`(`[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)` preferenceScreen) ` Called by[onClick()](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen#onClick())in order to navigate to a new screen of preferences.                                                                                                                                                                        |
  | ` boolean`                                                                                                                    | ` `[onPreferenceTreeClick](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onPreferenceTreeClick(android.support.v7.preference.Preference))`(`[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)` preference) ` Called when a preference in the tree rooted at this[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)has been clicked.                                                                                                                                                                                      |
  | ` void`                                                                                                                       | ` `[onSaveInstanceState](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#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/v7/preference/PreferenceFragmentCompat#onStart())`() ` Called when the Fragment is visible to the user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | ` void`                                                                                                                       | ` `[onStop](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onStop())`() ` Called when the Fragment is no longer started.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | ` void`                                                                                                                       | ` `[onViewCreated](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#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`                                                                                                                       | ` `[scrollToPreference](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#scrollToPreference(android.support.v7.preference.Preference))`(`[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)` preference) `                                                                                                                                                                                                                                                                                                                                                                           |
  | ` void`                                                                                                                       | ` `[scrollToPreference](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#scrollToPreference(java.lang.String))`(String key) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | ` void`                                                                                                                       | ` `[setDivider](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDivider(android.graphics.drawable.Drawable))`(`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)` divider) ` Sets the drawable that will be drawn between each item in the list.                                                                                                                                                                                                                                                                                                                                   |
  | ` void`                                                                                                                       | ` `[setDividerHeight](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDividerHeight(int))`(int height) ` Sets the height of the divider that will be drawn between each item in the list.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | ` void`                                                                                                                       | ` `[setPreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setPreferenceScreen(android.support.v7.preference.PreferenceScreen))`(`[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)` preferenceScreen) ` Sets the root of the preference hierarchy that this fragment is showing.                                                                                                                                                                                                                                                                        |
  | ` void`                                                                                                                       | ` `[setPreferencesFromResource](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setPreferencesFromResource(int, java.lang.String))`(int preferencesResId, String key) ` Inflates the given XML resource and replaces the current preference hierarchy (if any) with the preference hierarchy rooted at`key`.                                                                                                                                                                                                                                                                                                                    |

  |                                                                                                                                                                                                                 ### Protected methods                                                                                                                                                                                                                  ||
  |------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | ` `[Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter) | ` `[onCreateAdapter](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreateAdapter(android.support.v7.preference.PreferenceScreen))`(`[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)` preferenceScreen) ` Creates the root adapter. |

  | ### Inherited methods |
  |-----------------------|---|
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)From class` `[android.support.v4.app.Fragment](https://developer.android.com/reference/android/support/v4/app/Fragment)` ` |--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | ||
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)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/v7/preference/PreferenceFragmentCompat#)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/v7/preference/PreferenceFragmentCompat#)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/v7/preference/PreferenceFragmentCompat#)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/v7/preference/PreferenceFragmentCompat#)From interface` android.arch.lifecycle.ViewModelStoreOwner ` |----------------------------|-------------------------| | ` abstract ViewModelStore` | ` getViewModelStore() ` | ||
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)From interface` `[android.support.v7.preference.PreferenceManager.OnPreferenceTreeClickListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnPreferenceTreeClickListener)` ` |---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean` | ` `[onPreferenceTreeClick](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnPreferenceTreeClickListener#onPreferenceTreeClick(android.support.v7.preference.Preference))`(`[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)` preference) ` Called when a preference in the tree rooted at this[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)has been clicked. | ||
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)From interface` `[android.support.v7.preference.PreferenceManager.OnDisplayPreferenceDialogListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnDisplayPreferenceDialogListener)` ` |------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[onDisplayPreferenceDialog](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnDisplayPreferenceDialogListener#onDisplayPreferenceDialog(android.support.v7.preference.Preference))`(`[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)` preference) ` Called when a preference in the tree requests to display a dialog. | ||
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)From interface` `[android.support.v7.preference.PreferenceManager.OnNavigateToScreenListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnNavigateToScreenListener)` ` |------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[onNavigateToScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnNavigateToScreenListener#onNavigateToScreen(android.support.v7.preference.PreferenceScreen))`(`[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)` preferenceScreen) ` Called when a PreferenceScreen in the tree requests to navigate to its contents. | ||
  | [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#)From interface` `[android.support.v7.preference.DialogPreference.TargetFragment](https://developer.android.com/reference/android/support/v7/preference/DialogPreference.TargetFragment)` ` |------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference) | ` `[findPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference.TargetFragment#findPreference(java.lang.CharSequence))`(CharSequence key) ` | ||

  ## XML attributes

  ### PreferenceFragmentCompat_android_divider

  <br />

  <br />

  **Related methods:**
  - [setDivider(Drawable)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDivider(android.graphics.drawable.Drawable))

  ### PreferenceFragmentCompat_android_dividerHeight

  <br />

  <br />

  **Related methods:**
  - [setDividerHeight(int)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDividerHeight(int))

  ## Constants

  ### ARG_PREFERENCE_ROOT

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

  ```
  String ARG_PREFERENCE_ROOT
  ```

  Fragment argument used to specify the tag of the desired root[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)object.

  <br />

  Constant Value: "android.support.v7.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"

  ## Public constructors

  ### PreferenceFragmentCompat

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

  ```
  PreferenceFragmentCompat ()
  ```

  <br />

  <br />

  ## Public methods

  ### addPreferencesFromResource

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

  ```
  void addPreferencesFromResource (int preferencesResId)
  ```

  Inflates the given XML resource and adds the preference hierarchy to the current preference hierarchy.

  <br />

  |                            Parameters                             ||
  |--------------------|-----------------------------------------------|
  | `preferencesResId` | `int`: The XML resource ID to inflate. <br /> |

  ### findPreference

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

  ```
  Preference findPreference (CharSequence key)
  ```

  Finds a[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)based on its key.

  <br />

  |                              Parameters                              ||
  |-------|---------------------------------------------------------------|
  | `key` | `CharSequence`: The key of the preference to retrieve. <br /> |

  |                                                                                                            Returns                                                                                                             ||
  |------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
  | [Preference](https://developer.android.com/reference/android/support/v7/preference/Preference) | The[Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)with the key, or null. <br /> |

  **See also:**
  - [findPreference(CharSequence)](https://developer.android.com/reference/android/support/v7/preference/PreferenceGroup#findPreference(java.lang.CharSequence))  

  ### getListView

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

  ```
  RecyclerView getListView ()
  ```

  <br />

  <br />

  |                                                Returns                                                 ||
  |------------------------------------------------------------------------------------------------|--------|
  | [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView) | <br /> |

  ### getPreferenceManager

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

  ```
  PreferenceManager getPreferenceManager ()
  ```

  Returns the[PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager)used by this fragment.

  <br />

  |                                                                                                                Returns                                                                                                                ||
  |--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
  | [PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager) | The[PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager). <br /> |

  ### getPreferenceScreen

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

  ```
  PreferenceScreen getPreferenceScreen ()
  ```

  Gets the root of the preference hierarchy that this fragment is showing.

  <br />

  |                                                                                                                                    Returns                                                                                                                                    ||
  |------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | [PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen) | The[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)that is the root of the preference hierarchy. <br /> |

  ### onActivityCreated

  added in[version 24.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 /> |

  ### onCreate

  added in[version 24.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 /> |

  ### onCreateLayoutManager

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

  ```
  RecyclerView.LayoutManager onCreateLayoutManager ()
  ```

  Called from[onCreateRecyclerView(LayoutInflater, ViewGroup, Bundle)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreateRecyclerView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle))to create the[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager)for the created[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView).

  <br />

  |                                                                                                                                   Returns                                                                                                                                   ||
  |----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
  | [RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager) | A new[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager)instance. <br /> |

  ### onCreatePreferences

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

  ```
  void onCreatePreferences (Bundle savedInstanceState, 
                  String rootKey)
  ```

  Called during[onCreate(Bundle)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#onCreate(android.os.Bundle))to supply the preferences for this fragment. Subclasses are expected to call[setPreferenceScreen(PreferenceScreen)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setPreferenceScreen(android.support.v7.preference.PreferenceScreen))either directly or via helper methods such as[addPreferencesFromResource(int)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#addPreferencesFromResource(int)).

  <br />

  |                                                                                                          Parameters                                                                                                          ||
  |----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `savedInstanceState` | `Bundle`: If the fragment is being re-created from a previous saved state, this is the state. <br />                                                                                                   |
  | `rootKey`            | `String`: If non-null, this preference fragment should be rooted at the[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)with this key. <br /> |

  ### onCreateRecyclerView

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

  ```
  RecyclerView onCreateRecyclerView (LayoutInflater inflater, 
                  ViewGroup parent, 
                  Bundle savedInstanceState)
  ```

  Creates the[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)used to display the preferences. Subclasses may override this to return a customized[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView).

  <br />

  |                                                                                                                                   Parameters                                                                                                                                    ||
  |----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `inflater`           | `LayoutInflater`: The LayoutInflater object that can be used to inflate the[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView). <br />                                                                         |
  | `parent`             | `ViewGroup`: The parent[View](https://developer.android.com/reference/android/view/View.html)that the RecyclerView will be attached to. This method 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 view is being re-constructed from a previous saved state as given here <br />                                                                                                                                                 |

  |                                                                                Returns                                                                                ||
  |------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
  | [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView) | A new RecyclerView object to be placed into the view hierarchy <br /> |

  ### onCreateView

  added in[version 24.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 /> |

  ### onDestroyView

  added in[version 24.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 />

  ### onDisplayPreferenceDialog

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

  ```
  void onDisplayPreferenceDialog (Preference preference)
  ```

  Called when a preference in the tree requests to display a dialog. Subclasses should override this method to display custom dialogs or to handle dialogs for custom preference classes.

  <br />

  |                                   Parameters                                    ||
  |--------------|-------------------------------------------------------------------|
  | `preference` | `Preference`: The Preference object requesting the dialog. <br /> |

  ### onNavigateToScreen

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

  ```
  void onNavigateToScreen (PreferenceScreen preferenceScreen)
  ```

  Called by[onClick()](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen#onClick())in order to navigate to a new screen of preferences. Calls[onPreferenceStartScreen(PreferenceFragmentCompat, PreferenceScreen)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartScreenCallback#onPreferenceStartScreen(android.support.v7.preference.PreferenceFragmentCompat, android.support.v7.preference.PreferenceScreen))if the target fragment or containing activity implements[PreferenceFragmentCompat.OnPreferenceStartScreenCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartScreenCallback).

  <br />

  |                                                                                 Parameters                                                                                  ||
  |--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `preferenceScreen` | `PreferenceScreen`: The[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)to navigate to. <br /> |

  ### onPreferenceTreeClick

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

  ```
  boolean onPreferenceTreeClick (Preference preference)
  ```

  Called when a preference in the tree rooted at this[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)has been clicked.

  <br />

  |                             Parameters                              ||
  |--------------|-------------------------------------------------------|
  | `preference` | `Preference`: The preference that was clicked. <br /> |

  |                     Returns                      ||
  |-----------|---------------------------------------|
  | `boolean` | Whether the click was handled. <br /> |

  ### onSaveInstanceState

  added in[version 24.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 24.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 24.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 24.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/v7/preference/PreferenceFragmentCompat#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 />                                                                                                                                                             |

  ### scrollToPreference

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

  ```
  void scrollToPreference (Preference preference)
  ```

  <br />

  <br />

  |            Parameters             ||
  |--------------|---------------------|
  | `preference` | `Preference` <br /> |

  ### scrollToPreference

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

  ```
  void scrollToPreference (String key)
  ```

  <br />

  <br />

  |       Parameters       ||
  |-------|-----------------|
  | `key` | `String` <br /> |

  ### setDivider

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

  ```
  void setDivider (Drawable divider)
  ```

  Sets the drawable that will be drawn between each item in the list.

  **Note:** If the drawable does not have an intrinsic height, you should also call[setDividerHeight(int)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDividerHeight(int)).

  <br />

  **Related XML Attributes:**
  - [PreferenceFragmentCompat_android_divider](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#attr_PreferenceFragmentCompat_android_divider)

  |                    Parameters                     ||
  |-----------|----------------------------------------|
  | `divider` | `Drawable`: the drawable to use <br /> |

  ### setDividerHeight

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

  ```
  void setDividerHeight (int height)
  ```

  Sets the height of the divider that will be drawn between each item in the list. Calling this will override the intrinsic height as set by[setDivider(Drawable)](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#setDivider(android.graphics.drawable.Drawable))

  <br />

  **Related XML Attributes:**
  - [PreferenceFragmentCompat_android_dividerHeight](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat#attr_PreferenceFragmentCompat_android_dividerHeight)

  |                            Parameters                            ||
  |----------|--------------------------------------------------------|
  | `height` | `int`: The new height of the divider in pixels. <br /> |

  ### setPreferenceScreen

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

  ```
  void setPreferenceScreen (PreferenceScreen preferenceScreen)
  ```

  Sets the root of the preference hierarchy that this fragment is showing.

  <br />

  |                                                                                          Parameters                                                                                           ||
  |--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `preferenceScreen` | `PreferenceScreen`: The root[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)of the preference hierarchy. <br /> |

  ### setPreferencesFromResource

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

  ```
  void setPreferencesFromResource (int preferencesResId, 
                  String key)
  ```

  Inflates the given XML resource and replaces the current preference hierarchy (if any) with the preference hierarchy rooted at`key`.

  <br />

  |                                                                                                                                                                         Parameters                                                                                                                                                                         ||
  |--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | `preferencesResId` | `int`: The XML resource ID to inflate. <br />                                                                                                                                                                                                                                                                                          |
  | `key`              | `String`: The preference key of the[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)to use as the root of the preference hierarchy, or null to use the root[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen). <br /> |

  ## Protected methods

  ### onCreateAdapter

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

  ```
  Adapter onCreateAdapter (PreferenceScreen preferenceScreen)
  ```

  Creates the root adapter.

  <br />

  |                                             Parameters                                             ||
  |--------------------|--------------------------------------------------------------------------------|
  | `preferenceScreen` | `PreferenceScreen`: Preference screen object to create the adapter for. <br /> |

  |                                                                                                                                     Returns                                                                                                                                     ||
  |---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | [Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter) | An adapter that contains the preferences contained in this[PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen). <br /> |

-

  ## Interfaces

  - [DialogPreference.TargetFragment](https://developer.android.com/reference/android/support/v7/preference/DialogPreference.TargetFragment)
  - [Preference.OnPreferenceChangeListener](https://developer.android.com/reference/android/support/v7/preference/Preference.OnPreferenceChangeListener)
  - [Preference.OnPreferenceClickListener](https://developer.android.com/reference/android/support/v7/preference/Preference.OnPreferenceClickListener)
  - [PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback)
  - [PreferenceFragmentCompat.OnPreferenceStartFragmentCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartFragmentCallback)
  - [PreferenceFragmentCompat.OnPreferenceStartScreenCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat.OnPreferenceStartScreenCallback)
  - [PreferenceGroup.PreferencePositionCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceGroup.PreferencePositionCallback)
  - [PreferenceManager.OnDisplayPreferenceDialogListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnDisplayPreferenceDialogListener)
  - [PreferenceManager.OnNavigateToScreenListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnNavigateToScreenListener)
  - [PreferenceManager.OnPreferenceTreeClickListener](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.OnPreferenceTreeClickListener)
-

  ## Classes

  - [CheckBoxPreference](https://developer.android.com/reference/android/support/v7/preference/CheckBoxPreference)
  - [DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference)
  - [DropDownPreference](https://developer.android.com/reference/android/support/v7/preference/DropDownPreference)
  - [EditTextPreference](https://developer.android.com/reference/android/support/v7/preference/EditTextPreference)
  - [EditTextPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/EditTextPreferenceDialogFragmentCompat)
  - [ListPreference](https://developer.android.com/reference/android/support/v7/preference/ListPreference)
  - [ListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/ListPreferenceDialogFragmentCompat)
  - [MultiSelectListPreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/MultiSelectListPreferenceDialogFragmentCompat)
  - [Preference](https://developer.android.com/reference/android/support/v7/preference/Preference)
  - [Preference.BaseSavedState](https://developer.android.com/reference/android/support/v7/preference/Preference.BaseSavedState)
  - [PreferenceCategory](https://developer.android.com/reference/android/support/v7/preference/PreferenceCategory)
  - [PreferenceDataStore](https://developer.android.com/reference/android/support/v7/preference/PreferenceDataStore)
  - [PreferenceDialogFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceDialogFragmentCompat)
  - [PreferenceFragmentCompat](https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat)
  - [PreferenceGroup](https://developer.android.com/reference/android/support/v7/preference/PreferenceGroup)
  - [PreferenceManager](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager)
  - [PreferenceManager.PreferenceComparisonCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.PreferenceComparisonCallback)
  - [PreferenceManager.SimplePreferenceComparisonCallback](https://developer.android.com/reference/android/support/v7/preference/PreferenceManager.SimplePreferenceComparisonCallback)
  - [PreferenceScreen](https://developer.android.com/reference/android/support/v7/preference/PreferenceScreen)
  - [PreferenceViewHolder](https://developer.android.com/reference/android/support/v7/preference/PreferenceViewHolder)
  - [R](https://developer.android.com/reference/android/support/v7/preference/R)
  - [R.anim](https://developer.android.com/reference/android/support/v7/preference/R.anim)
  - [R.attr](https://developer.android.com/reference/android/support/v7/preference/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/v7/preference/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/v7/preference/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/v7/preference/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/v7/preference/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/v7/preference/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/v7/preference/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/v7/preference/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/v7/preference/R.string)
  - [R.style](https://developer.android.com/reference/android/support/v7/preference/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/v7/preference/R.styleable)
  - [SeekBarPreference](https://developer.android.com/reference/android/support/v7/preference/SeekBarPreference)
  - [SwitchPreferenceCompat](https://developer.android.com/reference/android/support/v7/preference/SwitchPreferenceCompat)
  - [TwoStatePreference](https://developer.android.com/reference/android/support/v7/preference/TwoStatePreference)