Stay organized with collections
Save and categorize content based on your preferences.
class MetadataResult : Parcelable
Result object given a corresponding MetadataRequest
.
- If the request was successful,
getResultCode
will be RESULT_OK
and getMetadataList
will be populated with metadata for all available preferences within this application.
- If the request is unsuccessful,
getResultCode
be a value other than RESULT_OK
- see documentation for those possibilities to understand the cause of the failure.
Summary
Constants |
static Int |
API call failed due to an issue with the service binding.
|
static Int |
Request is successful.
|
static Int |
No preferences in this application support this API.
|
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.
|
|
Constants
RESULT_INTERNAL_ERROR
static val RESULT_INTERNAL_ERROR: Int
API call failed due to an issue with the service binding.
Retry may succeed.
Value: 2
RESULT_OK
static val RESULT_OK: Int
Request is successful.
Value: 0
RESULT_UNSUPPORTED
static val RESULT_UNSUPPORTED: Int
No preferences in this application support this API.
Retry not advised.
Value: 1
Public methods
getResultCode
fun getResultCode(): Int
Returns the result code indicating status of the request.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[],null,["# MetadataResult\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMetadataResult\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/settings/preferences/MetadataResult \"View this page in Java\") \n\n```\nclass MetadataResult : Parcelable\n```\n\n|---|----------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.settings.preferences.MetadataResult](#) |\n\nResult object given a corresponding [MetadataRequest](/reference/kotlin/android/service/settings/preferences/MetadataRequest).\n\n- If the request was successful, [getResultCode](#getResultCode()) will be [RESULT_OK](#RESULT_OK:kotlin.Int) and [getMetadataList](#getMetadataList()) will be populated with metadata for all available preferences within this application.\n- If the request is unsuccessful, [getResultCode](#getResultCode()) be a value other than [RESULT_OK](#RESULT_OK:kotlin.Int) - see documentation for those possibilities to understand the cause of the failure.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| Nested classes ||\n|---|------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/service/settings/preferences/MetadataResult.Builder) Builder to construct [MetadataResult](#). |\n\n| Constants ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_INTERNAL_ERROR](#RESULT_INTERNAL_ERROR:kotlin.Int) API call failed due to an issue with the service binding. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_OK](#RESULT_OK:kotlin.Int) Request is successful. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_UNSUPPORTED](#RESULT_UNSUPPORTED:kotlin.Int) No preferences in this application support this API. |\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| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[SettingsPreferenceMetadata](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceMetadata)!\\\u003e | [getMetadataList](#getMetadataList())`()` Returns the list of available Preference Metadata. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getResultCode](#getResultCode())`()` Returns the result code indicating status of the request. |\n\n| Properties ||\n|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| static [Parcelable.Creator](../../../os/Parcelable.Creator.html#)\\\u003c[MetadataResult](#)!\\\u003e | [CREATOR](#CREATOR:android.os.Parcelable.Creator) Parcelable Creator for [MetadataResult](#). |\n\nConstants\n---------\n\n### RESULT_INTERNAL_ERROR\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_INTERNAL_ERROR: Int\n```\n\nAPI call failed due to an issue with the service binding.\n\nRetry may succeed. \n\n Value: 2\n\n### RESULT_OK\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_OK: Int\n```\n\nRequest is successful. \n\n Value: 0\n\n### RESULT_UNSUPPORTED\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_UNSUPPORTED: Int\n```\n\nNo preferences in this application support this API.\n\nRetry not advised. \n\n Value: 1\n\nPublic methods\n--------------\n\n### getMetadataList\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getMetadataList(): MutableList\u003cSettingsPreferenceMetadata!\u003e\n```\n\nReturns the list of available Preference Metadata.\n\nThis instance is shared so this list should not be modified. \n\n### getResultCode\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getResultCode(): Int\n```\n\nReturns the result code indicating status of the request.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is [android.service.settings.preferences.MetadataResult#RESULT_OK](#RESULT_OK:kotlin.Int), [android.service.settings.preferences.MetadataResult#RESULT_UNSUPPORTED](#RESULT_UNSUPPORTED:kotlin.Int), or [android.service.settings.preferences.MetadataResult#RESULT_INTERNAL_ERROR](#RESULT_INTERNAL_ERROR:kotlin.Int) |\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\u003cMetadataResult!\u003e\n```\n\nParcelable Creator for [MetadataResult](#)."]]