|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.preference.Preference
android.preference.PreferenceGroup
public abstract class PreferenceGroup
The PreferenceGroup class is a container for multiple
Preferences. It is a base class for Preference that are
parents, such as PreferenceCategory and PreferenceScreen.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.preference.Preference |
|---|
Preference.BaseSavedState, Preference.OnPreferenceChangeInternalListener, Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener |
| Field Summary |
|---|
| Fields inherited from class android.preference.Preference |
|---|
DEFAULT_ORDER |
| Constructor Summary | |
|---|---|
PreferenceGroup(Context context,
AttributeSet attrs)
|
|
PreferenceGroup(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
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. |
protected void |
dispatchRestoreInstanceState(Bundle container)
Called by Preference.restoreHierarchyState(android.os.Bundle) to retrieve the icicles for this
preference and its children. |
protected void |
dispatchSaveInstanceState(Bundle container)
Called by Preference.saveHierarchyState(android.os.Bundle) to store the icicles for this preference and its children. |
Preference |
findPreference(CharSequence key)
Finds a Preference based on its key. |
Preference |
getPreference(int index)
Returns the Preference at a particular index. |
int |
getPreferenceCount()
Returns the number of children Preferences. |
protected boolean |
isOnSameScreenAsChildren()
Whether this preference group should be shown on the same screen as its contained preferences. |
boolean |
isOrderingAsAdded()
Whether this group is ordering preferences in the order they are added. |
protected void |
onAttachedToActivity()
Called when the preference hierarchy has been attached to the PreferenceActivity. |
protected boolean |
onPrepareAddPreference(Preference preference)
Prepares a Preference to be added to the group. |
protected void |
onPrepareForRemoval()
Called when this Preference is being removed from the hierarchy. |
void |
removeAll()
Removes all Preferences from this group. |
boolean |
removePreference(Preference preference)
Removes a Preference from this group. |
void |
setEnabled(boolean enabled)
Sets whether this preference is enabled. |
void |
setOrderingAsAdded(boolean orderingAsAdded)
Whether to order the Preference children of this group as they
are added. |
(package private) void |
sortPreferences()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PreferenceGroup(Context context,
AttributeSet attrs,
int defStyle)
public PreferenceGroup(Context context,
AttributeSet attrs)
| Method Detail |
|---|
public void setOrderingAsAdded(boolean orderingAsAdded)
Preference children of this group as they
are added. If this is false, the ordering will follow each Preference
order and default to alphabetic for those without an order.
If this is called after preferences are added, they will not be re-ordered in the order they were added, hence call this method early on.
orderingAsAdded - Whether to order according to the order added.Preference.setOrder(int)public boolean isOrderingAsAdded()
setOrderingAsAdded(boolean)public void addItemFromInflater(Preference preference)
addItemFromInflater in interface GenericInflater.Parent<Preference>public int getPreferenceCount()
Preferences.
public Preference getPreference(int index)
Preference at a particular index.
index - The index of the Preference to retrieve.
Preference.public boolean addPreference(Preference preference)
Preference at the correct position based on the
preference's order.
preference - The preference to add.
public boolean removePreference(Preference preference)
Preference from this group.
preference - The preference to remove.
public void removeAll()
Preferences from this group.
protected boolean onPrepareAddPreference(Preference preference)
Preference to be added to the group.
preference - The preference to add.
public Preference findPreference(CharSequence key)
Preference based on its key. If two Preference
share the same key (not recommended), the first to appear will be
returned (to retrieve the other preference with the same key, call this
method on the first preference). If this preference has the key, it will
not be returned.
This will recursively search for the preference into children that are
also PreferenceGroups.
key - The key of the preference to retrieve.
Preference with the key, or null.protected boolean isOnSameScreenAsChildren()
protected void onAttachedToActivity()
PreferencePreferenceActivity. This can also be called when this
Preference has been attached to a group that was already attached
to the PreferenceActivity.
onAttachedToActivity in class Preferenceprotected void onPrepareForRemoval()
Preference
onPrepareForRemoval in class Preferencepublic void setEnabled(boolean enabled)
Preference
setEnabled in class Preferenceenabled - Whether the preference is enabled.void sortPreferences()
protected void dispatchSaveInstanceState(Bundle container)
PreferencePreference.saveHierarchyState(android.os.Bundle) to store the icicles for this preference and its children.
May be overridden to modify how freezing happens to a preference's children; for example, some
preferences may want to not store icicles for their children.
dispatchSaveInstanceState in class Preferencecontainer - The Bundle in which to save the preference's icicles.Preference.dispatchRestoreInstanceState(android.os.Bundle),
Preference.saveHierarchyState(android.os.Bundle),
Preference.onSaveInstanceState()protected void dispatchRestoreInstanceState(Bundle container)
PreferencePreference.restoreHierarchyState(android.os.Bundle) to retrieve the icicles for this
preference and its children. May be overridden to modify how restoreing
happens to a preference's children; for example, some preferences may
want to not store icicles for their children.
dispatchRestoreInstanceState in class Preferencecontainer - The Bundle which holds previously frozen icicles.Preference.dispatchSaveInstanceState(android.os.Bundle),
Preference.restoreHierarchyState(android.os.Bundle),
Preference.onRestoreInstanceState(android.os.Parcelable)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||