java.lang.Object | ||||
android.preference.Preference | Comparable<T> | |||
android.preference.PreferenceGroup | ||||
android.preference.PreferenceScreen | DialogInterface.OnDismissListener AdapterView.OnItemClickListener |
The PreferenceScreen class represents a top-level Preference that is the root of a Preference hierarchy. A PreferenceActivity points to an instance of this class to show the preferences. To instantiate this class, use createPreferenceScreen(Context).
This class can appear in two places:
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="first_preferencescreen">
<CheckBoxPreference
android:key="wifi enabled"
android:title="WiFi" />
<PreferenceScreen
android:key="second_preferencescreen"
android:title="WiFi settings">
<CheckBoxPreference
android:key="prefer wifi"
android:title="Prefer WiFi" />
... other preferences here ...
</PreferenceScreen>
</PreferenceScreen>
In this example, the "first_preferencescreen" will be used as the root of the
hierarchy and given to a PreferenceActivity. The first screen will
show preferences "WiFi" (which can be used to quickly enable/disable WiFi)
and "WiFi settings". The "WiFi settings" is the "second_preferencescreen" and when
clicked will show another screen of preferences such as "Prefer WiFi" (and
the other preferences that are children of the "second_preferencescreen" tag).
void | bind(ListView listView) | |||||
Binds a ListView to the preferences contained in this PreferenceScreen via getRootAdapter(). | ||||||
Dialog | getDialog() | |||||
Used to get a handle to the dialog. | ||||||
ListAdapter | getRootAdapter() | |||||
Returns an adapter that can be attached to a PreferenceActivity to show the preferences contained in this PreferenceScreen. | ||||||
void | onDismiss(DialogInterface dialog) | |||||
This method will be invoked when the dialog is dismissed. | ||||||
void | onItemClick(AdapterView parent, View view, int position, long id) |
boolean | isOnSameScreenAsChildren() | |||||
Whether this preference group should be shown on the same screen as its contained preferences. | ||||||
void | onClick() | |||||
Processes a click on the preference. | ||||||
ListAdapter | onCreateRootAdapter() | |||||
Creates the root adapter. | ||||||
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. |
listView | The list view to attach to. |
---|
This PreferenceScreen will NOT appear in the returned adapter, instead it appears in the hierarchy above this PreferenceScreen.
This adapter's getItem(int) should always return a subclass of Preference.
state | The frozen state that had previously been returned by onSaveInstanceState(). |
---|
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:56 |