Stay organized with collections
Save and categorize content based on your preferences.
GetValueRequest
class GetValueRequest : Parcelable
Request parameters to retrieve the current value of a Settings Preference.
This object passed to SettingsPreferenceService.onGetPreferenceValue
will result in a GetValueResult
.
getScreenKey
is a parameter to distinguish the container screen of a preference as a preference key may not be unique within its application.
getPreferenceKey
is a parameter to identify the preference for which the value is being requested. These keys will be unique with their Preference Screen, but may not be unique within their application, so it is required to pair this with getScreenKey
to ensure this request matches the intended target.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods |
String |
Returns the key of requested Preference.
|
String |
Returns the screen key of requested Preference.
|
Public methods
getPreferenceKey
fun getPreferenceKey(): String
Returns the key of requested Preference.
getScreenKey
fun getScreenKey(): String
Returns the screen key of requested Preference.
Properties
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 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# GetValueRequest\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nGetValueRequest\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/settings/preferences/GetValueRequest \"View this page in Java\") \n\n```\nclass GetValueRequest : Parcelable\n```\n\n|---|-----------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.settings.preferences.GetValueRequest](#) |\n\nRequest parameters to retrieve the current value of a Settings Preference.\n\nThis object passed to [SettingsPreferenceService.onGetPreferenceValue](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceService#onGetPreferenceValue(android.service.settings.preferences.GetValueRequest,%20android.os.OutcomeReceiver)) will result in a [GetValueResult](/reference/kotlin/android/service/settings/preferences/GetValueResult).\n\n- [getScreenKey](#getScreenKey()) is a parameter to distinguish the container screen of a preference as a preference key may not be unique within its application.\n- [getPreferenceKey](#getPreferenceKey()) is a parameter to identify the preference for which the value is being requested. These keys will be unique with their Preference Screen, but may not be unique within their application, so it is required to pair this with [getScreenKey](#getScreenKey()) to ensure this request matches the intended target.\n\nSummary\n-------\n\n| Nested classes ||\n|---|--------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/service/settings/preferences/GetValueRequest.Builder) Builder to construct [GetValueRequest](#). |\n\n| Inherited constants ||\n|---|---|\n| From class [Parcelable](../../../os/Parcelable.html#) |----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](../../../os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) Descriptor bit used with [describeContents()](../../../os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](../../../os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) Flag for use with [writeToParcel](../../../os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as \"`Parcelable someFunction()`\", \"`void someFunction(out Parcelable)`\", or \"`void someFunction(inout Parcelable)`\". Some implementations may want to release resources at this point. \u003cbr /\u003e | ||\n\n| Public methods ||\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getPreferenceKey](#getPreferenceKey())`()` Returns the key of requested Preference. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getScreenKey](#getScreenKey())`()` Returns the screen key of requested Preference. |\n\n| Properties ||\n|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|\n| static [Parcelable.Creator](../../../os/Parcelable.Creator.html#)\\\u003c[GetValueRequest](#)!\\\u003e | [CREATOR](#CREATOR:android.os.Parcelable.Creator) Parcelable Creator for [GetValueRequest](#). |\n\nPublic methods\n--------------\n\n### getPreferenceKey\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPreferenceKey(): String\n```\n\nReturns the key of requested Preference. \n\n### getScreenKey\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getScreenKey(): String\n```\n\nReturns the screen key of requested Preference.\n\nProperties\n----------\n\n### CREATOR\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CREATOR: Parcelable.Creator\u003cGetValueRequest!\u003e\n```\n\nParcelable Creator for [GetValueRequest](#)."]]