Android APIs
public class

PreferenceCategory

extends PreferenceGroup
java.lang.Object
   ↳ android.preference.Preference
     ↳ android.preference.PreferenceGroup
       ↳ android.preference.PreferenceCategory

Class Overview

Used to group Preference objects and provide a disabled title above the group.

Developer Guides

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

Summary

[Expand]
Inherited XML Attributes
From class android.preference.PreferenceGroup
From class android.preference.Preference
[Expand]
Inherited Constants
From class android.preference.Preference
Public Constructors
PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr)
PreferenceCategory(Context context, AttributeSet attrs)
PreferenceCategory(Context context)
Public Methods
boolean isEnabled()
Checks whether this Preference should be enabled in the list.
boolean shouldDisableDependents()
Checks whether this preference's dependents should currently be disabled.
Protected Methods
boolean onPrepareAddPreference(Preference preference)
Prepares a Preference to be added to the group.
[Expand]
Inherited Methods
From class android.preference.PreferenceGroup
From class android.preference.Preference
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public PreferenceCategory (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Added in API level 21

public PreferenceCategory (Context context, AttributeSet attrs, int defStyleAttr)

Added in API level 1

public PreferenceCategory (Context context, AttributeSet attrs)

Added in API level 1

public PreferenceCategory (Context context)

Added in API level 1

Public Methods

public boolean isEnabled ()

Added in API level 1

Checks whether this Preference should be enabled in the list.

Returns
  • True if this Preference is enabled, false otherwise.

public boolean shouldDisableDependents ()

Added in API level 1

Checks whether this preference's dependents should currently be disabled.

Returns
  • True if the dependents should be disabled, otherwise false.

Protected Methods

protected boolean onPrepareAddPreference (Preference preference)

Added in API level 1

Prepares a Preference to be added to the group.

Parameters
preference The preference to add.
Returns
  • Whether to allow adding the preference (true), or not (false).