to top
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

? Examples
PreferenceCategory( Context context, AttributeSet attrs, int defStyle)

? Examples
PreferenceCategory( Context context, AttributeSet attrs)

? Examples
PreferenceCategory( Context context)
Public Methods

? Examples
boolean isEnabled()
Checks whether this Preference should be enabled in the list.
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 defStyle)

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.

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).
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.