IT. Expert System.

Android Reference

PreferenceScreen


android.preference

Class PreferenceScreen

  • All Implemented Interfaces:
    DialogInterface.OnDismissListener, GenericInflater.Parent<Preference>, AdapterView.OnItemClickListener, Comparable<Preference>


    public final class PreferenceScreen
    extends PreferenceGroup
    implements AdapterView.OnItemClickListener, DialogInterface.OnDismissListener
    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 PreferenceManager.createPreferenceScreen(Context).
      This class can appear in two places:
    • When a PreferenceActivity points to this, it is used as the root and is not shown (only the contained preferences are shown).
    • When it appears inside another preference hierarchy, it is shown and serves as the gateway to another screen of preferences (either by showing another screen of preferences as a Dialog or via a Context.startActivity(android.content.Intent) from the Preference.getIntent()). The children of this PreferenceScreen are NOT shown in the screen that this PreferenceScreen is shown in. Instead, a separate screen will be shown when this preference is clicked.

    Here's an example XML layout of a PreferenceScreen:

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

    Developer Guides

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

    See Also:
    PreferenceCategory


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 604 / . Delta: 0.07841 с