SettingsPreferenceValue
public
final
class
SettingsPreferenceValue
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.service.settings.preferences.SettingsPreferenceValue |
This objects represents a value that can be used for a particular settings preference.
The data type for the value will correspond to getType(). For possible types, see
constants below, such as TYPE_BOOLEAN and TYPE_STRING.
Depending on the type, the corresponding getter will contain its value.
See documentation on the constants for which getter method should be used.
Summary
Nested classes | |
|---|---|
class |
SettingsPreferenceValue.Builder
Builder to construct |
Constants | |
|---|---|
int |
TYPE_BOOLEAN
Value is of type boolean. |
int |
TYPE_DOUBLE
Value is of type double. |
int |
TYPE_INT
Value is of type int. |
int |
TYPE_LONG
Value is of type long. |
int |
TYPE_STRING
Value is of type string. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<SettingsPreferenceValue> |
CREATOR
Parcelable Creator for |
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
getBooleanValue()
Returns the boolean value for Preference, the type must be |
double
|
getDoubleValue()
Returns the double value for Preference, the type must be |
int
|
getIntValue()
Returns the int value for Preference, the type must be |
long
|
getLongValue()
Returns the long value for Preference, the type must be |
String
|
getStringValue()
Returns the string value for Preference, the type must be |
int
|
getType()
Returns the type indicator for Preference value. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
Constants
TYPE_BOOLEAN
public static final int TYPE_BOOLEAN
Value is of type boolean. Access via getBooleanValue().
Constant Value: 0 (0x00000000)
TYPE_DOUBLE
public static final int TYPE_DOUBLE
Value is of type double. Access via getDoubleValue().
Constant Value: 2 (0x00000002)
TYPE_INT
public static final int TYPE_INT
Value is of type int. Access via getIntValue().
Constant Value: 4 (0x00000004)
TYPE_LONG
public static final int TYPE_LONG
Value is of type long. Access via getLongValue().
Constant Value: 1 (0x00000001)
TYPE_STRING
public static final int TYPE_STRING
Value is of type string. Access via getStringValue().
Constant Value: 3 (0x00000003)
Fields
CREATOR
public static final Creator<SettingsPreferenceValue> CREATOR
Parcelable Creator for SettingsPreferenceValue.
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or
|
getBooleanValue
public boolean getBooleanValue ()
Returns the boolean value for Preference, the type must be TYPE_BOOLEAN.
| Returns | |
|---|---|
boolean |
|
getDoubleValue
public double getDoubleValue ()
Returns the double value for Preference, the type must be TYPE_DOUBLE.
| Returns | |
|---|---|
double |
|
getIntValue
public int getIntValue ()
Returns the int value for Preference, the type must be TYPE_INT.
| Returns | |
|---|---|
int |
|
getLongValue
public long getLongValue ()
Returns the long value for Preference, the type must be TYPE_LONG.
| Returns | |
|---|---|
long |
|
getStringValue
public String getStringValue ()
Returns the string value for Preference, the type must be TYPE_STRING.
| Returns | |
|---|---|
String |
|
getType
public int getType ()
Returns the type indicator for Preference value.
| Returns | |
|---|---|
int |
Value is one of the following: |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written.
This value cannot be null. |
flags |
int: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-13 UTC.