Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder to construct SettingsPreferenceValue
.
Summary
Public constructors |
Create Builder instance.
|
Public constructors
Builder
Builder(type: Int)
Create Builder instance.
Public methods
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,["# SettingsPreferenceValue.Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/settings/preferences/SettingsPreferenceValue.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|---------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.settings.preferences.SettingsPreferenceValue.Builder](#) |\n\nBuilder to construct [SettingsPreferenceValue](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue).\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.Int))`(`type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Create Builder instance. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SettingsPreferenceValue](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue) | [build](#build())`()` Constructs an immutable [SettingsPreferenceValue](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue) object. |\n| [SettingsPreferenceValue.Builder](#) | [setBooleanValue](#setBooleanValue(kotlin.Boolean))`(`booleanValue:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets boolean value for Preference. |\n| [SettingsPreferenceValue.Builder](#) | [setDoubleValue](#setDoubleValue(kotlin.Double))`(`doubleValue:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Sets floating point value for Preference. |\n| [SettingsPreferenceValue.Builder](#) | [setIntValue](#setIntValue(kotlin.Int))`(`intValue:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the int value for Preference. |\n| [SettingsPreferenceValue.Builder](#) | [setLongValue](#setLongValue(kotlin.Long))`(`longValue:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets long value for Preference. |\n| [SettingsPreferenceValue.Builder](#) | [setStringValue](#setStringValue(kotlin.String))`(`stringValue:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets string value for Preference. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(type: Int)\n```\n\nCreate Builder instance.\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): type indicator for preference value Value is [android.service.settings.preferences.SettingsPreferenceValue#TYPE_BOOLEAN](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue#TYPE_BOOLEAN:kotlin.Int), [android.service.settings.preferences.SettingsPreferenceValue#TYPE_LONG](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue#TYPE_LONG:kotlin.Int), [android.service.settings.preferences.SettingsPreferenceValue#TYPE_DOUBLE](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue#TYPE_DOUBLE:kotlin.Int), [android.service.settings.preferences.SettingsPreferenceValue#TYPE_STRING](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue#TYPE_STRING:kotlin.Int), or [android.service.settings.preferences.SettingsPreferenceValue#TYPE_INT](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue#TYPE_INT:kotlin.Int) |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): SettingsPreferenceValue\n```\n\nConstructs an immutable [SettingsPreferenceValue](/reference/kotlin/android/service/settings/preferences/SettingsPreferenceValue) object. \n\n### setBooleanValue\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setBooleanValue(booleanValue: Boolean): SettingsPreferenceValue.Builder\n```\n\nSets boolean value for Preference. \n\n### setDoubleValue\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setDoubleValue(doubleValue: Double): SettingsPreferenceValue.Builder\n```\n\nSets floating point value for Preference. \n\n### setIntValue\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setIntValue(intValue: Int): SettingsPreferenceValue.Builder\n```\n\nSets the int value for Preference. \n\n### setLongValue\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setLongValue(longValue: Long): SettingsPreferenceValue.Builder\n```\n\nSets long value for Preference. \n\n### setStringValue\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setStringValue(stringValue: String?): SettingsPreferenceValue.Builder\n```\n\nSets string value for Preference."]]