Android.Preferences.PreferenceScreen Class
Represents a top-level Android.Preferences.Preference that is the root of a Preference hierarchy.

See Also: PreferenceScreen Members

Syntax

[Android.Runtime.Register("android/preference/PreferenceScreen", DoNotGenerateAcw=true)]
public sealed class PreferenceScreen : PreferenceGroup, Android.Content.IDialogInterfaceOnDismissListener, Android.Widget.AdapterView.IOnItemClickListener, IDisposable

Remarks

Represents a top-level Android.Preferences.Preference that is the root of a Preference hierarchy. A Android.Preferences.PreferenceActivity points to an instance of this class to show the preferences. To instantiate this class, use PreferenceManager.CreatePreferenceScreen(Android.Content.Context).

Here's an example XML layout of a PreferenceScreen:

xml Example

<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 Android.Preferences.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).

Developer Guides

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

See Also

[Android Documentation]

Requirements

Namespace: Android.Preferences
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1