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-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Settings\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1 \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nSettings\n========\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\nclass\nSettings\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.v17.leanback.system.Settings |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nProvides various preferences affecting Leanback runtime behavior.\n\nNote this class is not thread safe and its methods should only\nbe invoked from the UI thread\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Constants ||\n|----------|----------------------------------------------------------------------------------------------------------------|\n| `String` | [OUTLINE_CLIPPING_DISABLED](/reference/android/support/v17/leanback/system/Settings#OUTLINE_CLIPPING_DISABLED) |\n| `String` | [PREFER_STATIC_SHADOWS](/reference/android/support/v17/leanback/system/Settings#PREFER_STATIC_SHADOWS) |\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` boolean` | ` `[getBoolean](/reference/android/support/v17/leanback/system/Settings#getBoolean(java.lang.String))`(String key) ` Returns the boolean preference for the given key. |\n| ` static `[Settings](/reference/android/support/v17/leanback/system/Settings) | ` `[getInstance](/reference/android/support/v17/leanback/system/Settings#getInstance(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Returns the singleton Settings instance. |\n| ` void` | ` `[setBoolean](/reference/android/support/v17/leanback/system/Settings#setBoolean(java.lang.String, boolean))`(String key, boolean value) ` Sets the boolean preference for the given key. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nConstants\n---------\n\n### OUTLINE_CLIPPING_DISABLED\n\nadded in [version 27.1.0](/topic/libraries/support-library/revisions) \n\n```\nString OUTLINE_CLIPPING_DISABLED\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n\"OUTLINE_CLIPPING_DISABLED\"\n\n\n### PREFER_STATIC_SHADOWS\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nString PREFER_STATIC_SHADOWS\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n\"PREFER_STATIC_SHADOWS\"\n\n\nPublic methods\n--------------\n\n### getBoolean\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nboolean getBoolean (String key)\n```\n\nReturns the boolean preference for the given key.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-----------------|\n| `key` | `String` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### getInstance\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nSettings getInstance (Context context)\n```\n\nReturns the singleton Settings instance.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|------------------|\n| `context` | `Context` \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------------------------------------|--------|\n| [Settings](/reference/android/support/v17/leanback/system/Settings) | \u003cbr /\u003e |\n\n### setBoolean\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid setBoolean (String key, \n boolean value)\n```\n\nSets the boolean preference for the given key. If an app uses this api to override\na default preference, it must do so on every activity create.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------|\n| `key` | `String` \u003cbr /\u003e |\n| `value` | `boolean` \u003cbr /\u003e |\n\n-\n\n Classes\n -------\n\n - [Settings](/reference/android/support/v17/leanback/system/Settings)"]]