added in version 24.1.0
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1

PreferenceGroup

public abstract class PreferenceGroup
extends Preference

java.lang.Object
   ↳ android.support.v7.preference.Preference
     ↳ android.support.v7.preference.PreferenceGroup
Known Direct Subclasses


A container for multiple Preference objects. It is a base class for Preference objects that are parents, such as PreferenceCategory and PreferenceScreen.

Developer Guides

For information about building a settings UI with Preferences, read the Settings guide.

Summary

Nested classes

interface PreferenceGroup.PreferencePositionCallback

Interface for PreferenceGroup Adapters to implement so that scrollToPreference(String) and scrollToPreference(Preference) or scrollToPreference(String) and scrollToPreference(Preference) can determine the correct scroll position to request. 

XML attributes

PreferenceGroup_initialExpandedChildrenCount  

Inherited XML attributes

From class android.support.v7.preference.Preference

Inherited constants

From class android.support.v7.preference.Preference

Public constructors

PreferenceGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
PreferenceGroup(Context context, AttributeSet attrs, int defStyleAttr)
PreferenceGroup(Context context, AttributeSet attrs)

Public methods

void addItemFromInflater(Preference preference)

Called by the inflater to add an item to this group.

boolean addPreference(Preference preference)

Adds a Preference at the correct position based on the preference's order.

Preference findPreference(CharSequence key)

Finds a Preference based on its key.

int getInitialExpandedChildrenCount()

Gets the maximal number of children that is initially shown.

Preference getPreference(int index)

Returns the Preference at a particular index.

int getPreferenceCount()

Returns the number of children Preferences.

boolean isOrderingAsAdded()

Whether this group is ordering preferences in the order they are added.

void notifyDependencyChange(boolean disableDependents)

Notifies any listening dependents of a change that affects the dependency.

void onAttached()

Called when the Preference hierarchy has been attached to the list of preferences.

void onDetached()

Called when the Preference hierarchy has been detached from the list of preferences.

void removeAll()

Removes all Preferences from this group.

boolean removePreference(Preference preference)

Removes a Preference from this group.

void setInitialExpandedChildrenCount(int expandedCount)

Sets the maximal number of children that are shown when the preference group is launched where the rest of the children will be hidden.

void setOrderingAsAdded(boolean orderingAsAdded)

Whether to order the Preference children of this group as they are added.

Protected methods

void dispatchRestoreInstanceState(Bundle container)

Called by restoreHierarchyState(Bundle) to retrieve the saved state for this Preference and its children.

void dispatchSaveInstanceState(Bundle container)

Called by saveHierarchyState(Bundle) to store the instance for this Preference and its children.

boolean isOnSameScreenAsChildren()

Whether this preference group should be shown on the same screen as its contained preferences.

boolean onPrepareAddPreference(Preference preference)

Prepares a Preference to be added to the group.

void onRestoreInstanceState(Parcelable state)

Hook allowing a Preference to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState().

Parcelable onSaveInstanceState()

Hook allowing a Preference to generate a representation of its internal state that can later be used to create a new instance with that same state.

Inherited methods

From class android.support.v7.preference.Preference