# android.support.annotation

# android.support.annotation

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

## Annotations

|-------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AnimatorRes](https://developer.android.com/reference/android/support/annotation/AnimatorRes)                           | Denotes that an integer parameter, field or method return value is expected to be an animator resource reference (e.g.                                                                                          |
| [AnimRes](https://developer.android.com/reference/android/support/annotation/AnimRes)                                   | Denotes that an integer parameter, field or method return value is expected to be an anim resource reference (e.g.                                                                                              |
| [AnyRes](https://developer.android.com/reference/android/support/annotation/AnyRes)                                     | Denotes that an integer parameter, field or method return value is expected to be a resource reference of any type.                                                                                             |
| [AnyThread](https://developer.android.com/reference/android/support/annotation/AnyThread)                               | Denotes that the annotated method can be called from any thread (e.g.                                                                                                                                           |
| [ArrayRes](https://developer.android.com/reference/android/support/annotation/ArrayRes)                                 | Denotes that an integer parameter, field or method return value is expected to be an array resource reference (e.g.                                                                                             |
| [AttrRes](https://developer.android.com/reference/android/support/annotation/AttrRes)                                   | Denotes that an integer parameter, field or method return value is expected to be an attribute reference (e.g.                                                                                                  |
| [BinderThread](https://developer.android.com/reference/android/support/annotation/BinderThread)                         | Denotes that the annotated method should only be called on the binder thread.                                                                                                                                   |
| [BoolRes](https://developer.android.com/reference/android/support/annotation/BoolRes)                                   | Denotes that an integer parameter, field or method return value is expected to be a boolean resource reference.                                                                                                 |
| [CallSuper](https://developer.android.com/reference/android/support/annotation/CallSuper)                               | Denotes that any overriding methods should invoke this method as well.                                                                                                                                          |
| [CheckResult](https://developer.android.com/reference/android/support/annotation/CheckResult)                           | Denotes that the annotated method returns a result that it typically is an error to ignore.                                                                                                                     |
| [ColorInt](https://developer.android.com/reference/android/support/annotation/ColorInt)                                 | Denotes that the annotated element represents a packed color int,`AARRGGBB`.                                                                                                                                    |
| [ColorLong](https://developer.android.com/reference/android/support/annotation/ColorLong)                               | Denotes that the annotated element represents a packed color long.                                                                                                                                              |
| [ColorRes](https://developer.android.com/reference/android/support/annotation/ColorRes)                                 | Denotes that an integer parameter, field or method return value is expected to be a color resource reference (e.g.                                                                                              |
| [DimenRes](https://developer.android.com/reference/android/support/annotation/DimenRes)                                 | Denotes that an integer parameter, field or method return value is expected to be a dimension resource reference (e.g.                                                                                          |
| [Dimension](https://developer.android.com/reference/android/support/annotation/Dimension)                               | Denotes that an integer parameter, field or method return value is expected to represent a dimension.                                                                                                           |
| [DrawableRes](https://developer.android.com/reference/android/support/annotation/DrawableRes)                           | Denotes that an integer parameter, field or method return value is expected to be a drawable resource reference (e.g.                                                                                           |
| [FloatRange](https://developer.android.com/reference/android/support/annotation/FloatRange)                             | Denotes that the annotated element should be a float or double in the given range Example: @FloatRange(from=0.0,to=1.0) public float getAlpha() { ...                                                           |
| [FontRes](https://developer.android.com/reference/android/support/annotation/FontRes)                                   | Denotes that an integer parameter, field or method return value is expected to be a font resource reference (e.g.                                                                                               |
| [FractionRes](https://developer.android.com/reference/android/support/annotation/FractionRes)                           | Denotes that an integer parameter, field or method return value is expected to be a fraction resource reference.                                                                                                |
| [GuardedBy](https://developer.android.com/reference/android/support/annotation/GuardedBy)                               | Denotes that the annotated method or field can only be accessed when holding the referenced lock.                                                                                                               |
| [HalfFloat](https://developer.android.com/reference/android/support/annotation/HalfFloat)                               | Denotes that the annotated element represents a half-precision floating point value.                                                                                                                            |
| [IdRes](https://developer.android.com/reference/android/support/annotation/IdRes)                                       | Denotes that an integer parameter, field or method return value is expected to be an id resource reference (e.g.                                                                                                |
| [IntDef](https://developer.android.com/reference/android/support/annotation/IntDef)                                     | Denotes that the annotated element of integer type, represents a logical type and that its value should be one of the explicitly named constants.                                                               |
| [IntegerRes](https://developer.android.com/reference/android/support/annotation/IntegerRes)                             | Denotes that an integer parameter, field or method return value is expected to be an integer resource reference (e.g.                                                                                           |
| [InterpolatorRes](https://developer.android.com/reference/android/support/annotation/InterpolatorRes)                   | Denotes that an integer parameter, field or method return value is expected to be an interpolator resource reference (e.g.                                                                                      |
| [IntRange](https://developer.android.com/reference/android/support/annotation/IntRange)                                 | Denotes that the annotated element should be an int or long in the given range Example: @IntRange(from=0,to=255) public int getAlpha() { ...                                                                    |
| [Keep](https://developer.android.com/reference/android/support/annotation/Keep)                                         | Denotes that the annotated element should not be removed when the code is minified at build time.                                                                                                               |
| [LayoutRes](https://developer.android.com/reference/android/support/annotation/LayoutRes)                               | Denotes that an integer parameter, field or method return value is expected to be a layout resource reference (e.g.                                                                                             |
| [LongDef](https://developer.android.com/reference/android/support/annotation/LongDef)                                   | Denotes that the annotated long element represents a logical type and that its value should be one of the explicitly named constants.                                                                           |
| [MainThread](https://developer.android.com/reference/android/support/annotation/MainThread)                             | Denotes that the annotated method should only be called on the main thread.                                                                                                                                     |
| [MenuRes](https://developer.android.com/reference/android/support/annotation/MenuRes)                                   | Denotes that an integer parameter, field or method return value is expected to be a menu resource reference.                                                                                                    |
| [NavigationRes](https://developer.android.com/reference/android/support/annotation/NavigationRes)                       | Denotes that an integer parameter, field or method return value is expected to be a navigation resource reference (e.g.                                                                                         |
| [NonNull](https://developer.android.com/reference/android/support/annotation/NonNull)                                   | Denotes that a parameter, field or method return value can never be null.                                                                                                                                       |
| [Nullable](https://developer.android.com/reference/android/support/annotation/Nullable)                                 | Denotes that a parameter, field or method return value can be null.                                                                                                                                             |
| [PluralsRes](https://developer.android.com/reference/android/support/annotation/PluralsRes)                             | Denotes that an integer parameter, field or method return value is expected to be a plurals resource reference.                                                                                                 |
| [Px](https://developer.android.com/reference/android/support/annotation/Px)                                             | Denotes that an integer parameter, field or method return value is expected to represent a pixel dimension.                                                                                                     |
| [RawRes](https://developer.android.com/reference/android/support/annotation/RawRes)                                     | Denotes that an integer parameter, field or method return value is expected to be a raw resource reference.                                                                                                     |
| [RequiresApi](https://developer.android.com/reference/android/support/annotation/RequiresApi)                           | Denotes that the annotated element should only be called on the given API level or higher.                                                                                                                      |
| [RequiresPermission](https://developer.android.com/reference/android/support/annotation/RequiresPermission)             | Denotes that the annotated element requires (or may require) one or more permissions.                                                                                                                           |
| [RequiresPermission.Read](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Read)   | Specifies that the given permission is required for read operations.                                                                                                                                            |
| [RequiresPermission.Write](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Write) | Specifies that the given permission is required for write operations.                                                                                                                                           |
| [RestrictTo](https://developer.android.com/reference/android/support/annotation/RestrictTo)                             | Denotes that the annotated element should only be accessed from within a specific scope (as defined by[RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)). |
| [Size](https://developer.android.com/reference/android/support/annotation/Size)                                         | Denotes that the annotated element should have a given size or length.                                                                                                                                          |
| [StringDef](https://developer.android.com/reference/android/support/annotation/StringDef)                               | Denotes that the annotated String element, represents a logical type and that its value should be one of the explicitly named constants.                                                                        |
| [StringRes](https://developer.android.com/reference/android/support/annotation/StringRes)                               | Denotes that an integer parameter, field or method return value is expected to be a String resource reference (e.g.                                                                                             |
| [StyleableRes](https://developer.android.com/reference/android/support/annotation/StyleableRes)                         | Denotes that an integer parameter, field or method return value is expected to be a styleable resource reference (e.g.                                                                                          |
| [StyleRes](https://developer.android.com/reference/android/support/annotation/StyleRes)                                 | Denotes that an integer parameter, field or method return value is expected to be a style resource reference (e.g.                                                                                              |
| [TransitionRes](https://developer.android.com/reference/android/support/annotation/TransitionRes)                       | Denotes that an integer parameter, field or method return value is expected to be a transition resource reference.                                                                                              |
| [UiThread](https://developer.android.com/reference/android/support/annotation/UiThread)                                 | Denotes that the annotated method or constructor should only be called on the UI thread.                                                                                                                        |
| [VisibleForTesting](https://developer.android.com/reference/android/support/annotation/VisibleForTesting)               | Denotes that the class, method or field has its visibility relaxed, so that it is more widely visible than otherwise necessary to make code testable.                                                           |
| [WorkerThread](https://developer.android.com/reference/android/support/annotation/WorkerThread)                         | Denotes that the annotated method should only be called on a worker thread.                                                                                                                                     |
| [XmlRes](https://developer.android.com/reference/android/support/annotation/XmlRes)                                     | Denotes that an integer parameter, field or method return value is expected to be an XML resource reference.                                                                                                    |

## Enums

|---------------------------------------------------------------------------------------------------------|---|
| [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope) |   |

-

  ## Annotations

  - [AnimatorRes](https://developer.android.com/reference/android/support/annotation/AnimatorRes)
  - [AnimRes](https://developer.android.com/reference/android/support/annotation/AnimRes)
  - [AnyRes](https://developer.android.com/reference/android/support/annotation/AnyRes)
  - [AnyThread](https://developer.android.com/reference/android/support/annotation/AnyThread)
  - [ArrayRes](https://developer.android.com/reference/android/support/annotation/ArrayRes)
  - [AttrRes](https://developer.android.com/reference/android/support/annotation/AttrRes)
  - [BinderThread](https://developer.android.com/reference/android/support/annotation/BinderThread)
  - [BoolRes](https://developer.android.com/reference/android/support/annotation/BoolRes)
  - [CallSuper](https://developer.android.com/reference/android/support/annotation/CallSuper)
  - [CheckResult](https://developer.android.com/reference/android/support/annotation/CheckResult)
  - [ColorInt](https://developer.android.com/reference/android/support/annotation/ColorInt)
  - [ColorLong](https://developer.android.com/reference/android/support/annotation/ColorLong)
  - [ColorRes](https://developer.android.com/reference/android/support/annotation/ColorRes)
  - [DimenRes](https://developer.android.com/reference/android/support/annotation/DimenRes)
  - [Dimension](https://developer.android.com/reference/android/support/annotation/Dimension)
  - [DrawableRes](https://developer.android.com/reference/android/support/annotation/DrawableRes)
  - [FloatRange](https://developer.android.com/reference/android/support/annotation/FloatRange)
  - [FontRes](https://developer.android.com/reference/android/support/annotation/FontRes)
  - [FractionRes](https://developer.android.com/reference/android/support/annotation/FractionRes)
  - [GuardedBy](https://developer.android.com/reference/android/support/annotation/GuardedBy)
  - [HalfFloat](https://developer.android.com/reference/android/support/annotation/HalfFloat)
  - [IdRes](https://developer.android.com/reference/android/support/annotation/IdRes)
  - [IntDef](https://developer.android.com/reference/android/support/annotation/IntDef)
  - [IntegerRes](https://developer.android.com/reference/android/support/annotation/IntegerRes)
  - [InterpolatorRes](https://developer.android.com/reference/android/support/annotation/InterpolatorRes)
  - [IntRange](https://developer.android.com/reference/android/support/annotation/IntRange)
  - [Keep](https://developer.android.com/reference/android/support/annotation/Keep)
  - [LayoutRes](https://developer.android.com/reference/android/support/annotation/LayoutRes)
  - [LongDef](https://developer.android.com/reference/android/support/annotation/LongDef)
  - [MainThread](https://developer.android.com/reference/android/support/annotation/MainThread)
  - [MenuRes](https://developer.android.com/reference/android/support/annotation/MenuRes)
  - [NavigationRes](https://developer.android.com/reference/android/support/annotation/NavigationRes)
  - [NonNull](https://developer.android.com/reference/android/support/annotation/NonNull)
  - [Nullable](https://developer.android.com/reference/android/support/annotation/Nullable)
  - [PluralsRes](https://developer.android.com/reference/android/support/annotation/PluralsRes)
  - [Px](https://developer.android.com/reference/android/support/annotation/Px)
  - [RawRes](https://developer.android.com/reference/android/support/annotation/RawRes)
  - [RequiresApi](https://developer.android.com/reference/android/support/annotation/RequiresApi)
  - [RequiresPermission](https://developer.android.com/reference/android/support/annotation/RequiresPermission)
  - [RequiresPermission.Read](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Read)
  - [RequiresPermission.Write](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Write)
  - [RestrictTo](https://developer.android.com/reference/android/support/annotation/RestrictTo)
  - [Size](https://developer.android.com/reference/android/support/annotation/Size)
  - [StringDef](https://developer.android.com/reference/android/support/annotation/StringDef)
  - [StringRes](https://developer.android.com/reference/android/support/annotation/StringRes)
  - [StyleableRes](https://developer.android.com/reference/android/support/annotation/StyleableRes)
  - [StyleRes](https://developer.android.com/reference/android/support/annotation/StyleRes)
  - [TransitionRes](https://developer.android.com/reference/android/support/annotation/TransitionRes)
  - [UiThread](https://developer.android.com/reference/android/support/annotation/UiThread)
  - [VisibleForTesting](https://developer.android.com/reference/android/support/annotation/VisibleForTesting)
  - [WorkerThread](https://developer.android.com/reference/android/support/annotation/WorkerThread)
  - [XmlRes](https://developer.android.com/reference/android/support/annotation/XmlRes)
-

  ## Enums

  - [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)