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.
[[["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-02-10 UTC."],[],[],null,["# CoordinatorLayout.DefaultBehavior\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:coordinatorlayout:28.0.0-alpha1 \nDeprecated since version 27.1.0 \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nCoordinatorLayout.DefaultBehavior\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\nstatic\n\nabstract\n@interface\nCoordinatorLayout.DefaultBehavior\n`\n\n\n`\n\n\nimplements\n\nAnnotation\n\n\n`\n\n|-----------------------------------------------------------------|\n| android.support.design.widget.CoordinatorLayout.DefaultBehavior |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This @interface was deprecated\nin API level 27.1.0.** \n\nUse [CoordinatorLayout.AttachedBehavior](/reference/android/support/design/widget/CoordinatorLayout.AttachedBehavior) instead\n\nDefines the default [CoordinatorLayout.Behavior](/reference/android/support/design/widget/CoordinatorLayout.Behavior) of a [View](https://developer.android.com/reference/android/view/View.html) class.\n\nWhen writing a custom view, use this annotation to define the default behavior\nwhen used as a direct child of an [CoordinatorLayout](/reference/android/support/design/widget/CoordinatorLayout). The default behavior\ncan be overridden using [setBehavior(CoordinatorLayout.Behavior)](/reference/android/support/design/widget/CoordinatorLayout.LayoutParams#setBehavior(android.support.design.widget.CoordinatorLayout.Behavior)).\n\nExample: `@DefaultBehavior(MyBehavior.class)`\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| ` Class\u003c? extends `[Behavior](/reference/android/support/design/widget/CoordinatorLayout.Behavior)`\u003e` | ` `[value](/reference/android/support/design/widget/CoordinatorLayout.DefaultBehavior#value())`() ` |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` java.lang.annotation.Annotation ` |-----------------------------------------|-------------------------| | ` abstract Class\u003c? extends Annotation\u003e` | ` annotationType() ` | | ` abstract boolean` | ` equals(Object arg0) ` | | ` abstract int` | ` hashCode() ` | | ` abstract String` | ` toString() ` | ||\n\nPublic methods\n--------------\n\n### value\n\n```\nClass\u003c? extends Behavior\u003e value ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------|--------|\n| `Class\u003c? extends `[Behavior](/reference/android/support/design/widget/CoordinatorLayout.Behavior)`\u003e` | \u003cbr /\u003e |\n\n-\n\n Annotations\n -----------\n\n - [CoordinatorLayout.DefaultBehavior](/reference/android/support/design/widget/CoordinatorLayout.DefaultBehavior)\n-\n\n Interfaces\n ----------\n\n - [CoordinatorLayout.AttachedBehavior](/reference/android/support/design/widget/CoordinatorLayout.AttachedBehavior)\n-\n\n Classes\n -------\n\n - [CoordinatorLayout](/reference/android/support/design/widget/CoordinatorLayout)\n - [CoordinatorLayout.Behavior](/reference/android/support/design/widget/CoordinatorLayout.Behavior)\n - [CoordinatorLayout.LayoutParams](/reference/android/support/design/widget/CoordinatorLayout.LayoutParams)\n - [CoordinatorLayout.SavedState](/reference/android/support/design/widget/CoordinatorLayout.SavedState)"]]