# androidx.annotation

*** ** * ** ***

## Annotations

|---|---|
| `https://developer.android.com/reference/androidx/annotation/AnimRes` | Denotes that an integer parameter, field or method return value is expected to be an anim resource reference (e.g. `android.R.anim.fade_in`). |
| `https://developer.android.com/reference/androidx/annotation/AnimatorRes` | Denotes that an integer parameter, field or method return value is expected to be an animator resource reference (e.g. `android.R.animator.fade_in`). |
| `https://developer.android.com/reference/androidx/annotation/AnyRes` | Denotes that an integer parameter, field or method return value is expected to be a resource reference of any type. |
| `https://developer.android.com/reference/androidx/annotation/AnyThread` | Denotes that the annotated method can be called from any thread (e.g. it is "thread safe".) If the annotated element is a class, then all methods in the class can be called from any thread. |
| `https://developer.android.com/reference/androidx/annotation/ArrayRes` | Denotes that an integer parameter, field or method return value is expected to be an array resource reference (e.g. `android.R.array.phoneTypes`). |
| `https://developer.android.com/reference/androidx/annotation/AttrRes` | Denotes that an integer parameter, field or method return value is expected to be an attribute reference (e.g. `android.R.attr.action`). |
| `https://developer.android.com/reference/androidx/annotation/BinderThread` | Denotes that the annotated method should only be called on the binder thread. |
| `https://developer.android.com/reference/androidx/annotation/BoolRes` | Denotes that an integer parameter, field or method return value is expected to be a boolean resource reference. |
| `https://developer.android.com/reference/androidx/annotation/CallSuper` | Denotes that any overriding methods should invoke this method as well. |
| `https://developer.android.com/reference/androidx/annotation/CheckResult` | Denotes that the annotated method returns a result that it typically is an error to ignore. |
| `https://developer.android.com/reference/androidx/annotation/ChecksSdkIntAtLeast` | Denotes that the annotated method checks if the SDK_INT API level is at least the given value, and either returns it or executes the given lambda in that case (or if it's a field, has the value true). |
| `https://developer.android.com/reference/androidx/annotation/ColorInt` | Denotes that the annotated element represents a packed color int, `AARRGGBB`. |
| `https://developer.android.com/reference/androidx/annotation/ColorLong` | Denotes that the annotated element represents a packed color long. |
| `https://developer.android.com/reference/androidx/annotation/ColorRes` | Denotes that an integer parameter, field or method return value is expected to be a color resource reference (e.g. `android.R.color.black`). |
| `https://developer.android.com/reference/androidx/annotation/ContentView` | Annotation that can be attached to a constructor with a single `https://developer.android.com/reference/androidx/annotation/LayoutRes` parameter to denote what layout the component intends to inflate and set as its content. |
| `https://developer.android.com/reference/androidx/annotation/DeprecatedSinceApi` | Denotes that this API is only useful until the given API level; after that, a more suitable platform API is available. |
| `https://developer.android.com/reference/androidx/annotation/DimenRes` | Denotes that an integer parameter, field or method return value is expected to be a dimension resource reference (e.g. `android.R.dimen.app_icon_size`). |
| `https://developer.android.com/reference/androidx/annotation/Dimension` | Denotes that an integer parameter, field or method return value is expected to represent a dimension. |
| `https://developer.android.com/reference/androidx/annotation/Discouraged` | Denotes that the annotated element, while not disallowed or deprecated, is one that programmers are generally discouraged from using. |
| `https://developer.android.com/reference/androidx/annotation/DisplayContext` | Denotes a `https://developer.android.com/reference/android/content/Context.html` that is tied to a `https://developer.android.com/reference/android/view/Display.html` and can be used to obtain one via `https://developer.android.com/reference/android/content/Context.html#getDisplay()`. |
| `https://developer.android.com/reference/androidx/annotation/DoNotInline` | Denotes that the annotated method should not be inlined when the code is optimized at build time. |
| `https://developer.android.com/reference/androidx/annotation/DrawableRes` | Denotes that an integer parameter, field or method return value is expected to be a drawable resource reference (e.g. `android.R.attr.alertDialogIcon`). |
| `https://developer.android.com/reference/androidx/annotation/EmptySuper` | Denotes that any overriding methods should **not** invoke this method, since it is defined to be empty (or perhaps contain other code not intended to be run when overridden). |
| `https://developer.android.com/reference/androidx/annotation/FloatRange` | Denotes that the annotated element should be a float or double in the given range |
| `https://developer.android.com/reference/androidx/annotation/FontRes` | Denotes that an integer parameter, field or method return value is expected to be a font resource reference (e.g. |
| `https://developer.android.com/reference/androidx/annotation/FractionRes` | Denotes that an integer parameter, field or method return value is expected to be a fraction resource reference. |
| `https://developer.android.com/reference/androidx/annotation/GravityInt` | Denotes that the annotated element represents a packed gravity int. |
| `https://developer.android.com/reference/androidx/annotation/GuardedBy` | Denotes that the annotated method or field can only be accessed when holding the referenced lock. |
| `https://developer.android.com/reference/androidx/annotation/HalfFloat` | Denotes that the annotated element represents a half-precision floating point value. |
| `https://developer.android.com/reference/androidx/annotation/IdRes` | Denotes that an integer parameter, field or method return value is expected to be an id resource reference (e.g. `android.R.id.copy`). |
| `https://developer.android.com/reference/androidx/annotation/InspectableProperty` | **This annotation is deprecated.** Replaced by the androidx.resourceinpsection package. |
| `https://developer.android.com/reference/androidx/annotation/InspectableProperty.EnumEntry` | **This annotation is deprecated.** Replaced by the androidx.resourceinpsection package. |
| `https://developer.android.com/reference/androidx/annotation/InspectableProperty.FlagEntry` | **This annotation is deprecated.** Replaced by the androidx.resourceinpsection package. |
| `https://developer.android.com/reference/androidx/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. |
| `https://developer.android.com/reference/androidx/annotation/IntRange` | Denotes that the annotated element should be an int or long in the given range. |
| `https://developer.android.com/reference/androidx/annotation/IntegerRes` | Denotes that an integer parameter, field or method return value is expected to be an integer resource reference (e.g. `android.R.integer.config_shortAnimTime`). |
| `https://developer.android.com/reference/androidx/annotation/InterpolatorRes` | Denotes that an integer parameter, field or method return value is expected to be an interpolator resource reference (e.g. `android.R.interpolator.cycle`). |
| `https://developer.android.com/reference/androidx/annotation/Keep` | Denotes that the annotated element should not be removed when the code is minified at build time. |
| `https://developer.android.com/reference/androidx/annotation/LayoutRes` | Denotes that an integer parameter, field or method return value is expected to be a layout resource reference (e.g. `android.R.layout.list_content`). |
| `https://developer.android.com/reference/androidx/annotation/LongDef` | Denotes that the annotated long element represents a logical type and that its value should be one of the explicitly named constants. |
| `https://developer.android.com/reference/androidx/annotation/MainThread` | Denotes that the annotated method should only be called on the main thread. |
| `https://developer.android.com/reference/androidx/annotation/MenuRes` | Denotes that an integer parameter, field or method return value is expected to be a menu resource reference. |
| `https://developer.android.com/reference/androidx/annotation/NavigationRes` | Denotes that an integer parameter, field or method return value is expected to be a navigation resource reference (e.g. |
| `https://developer.android.com/reference/androidx/annotation/NonNull` | Denotes that a parameter, field or method return value can never be null. |
| `https://developer.android.com/reference/androidx/annotation/NonUiContext` | Denotes a `https://developer.android.com/reference/android/content/Context.html` that **can not** be used to obtain a `https://developer.android.com/reference/android/view/Display.html` via `https://developer.android.com/reference/android/content/Context.html#getDisplay()` nor to obtain an instance of a visual service, such a `https://developer.android.com/reference/android/view/WindowManager.html`, `https://developer.android.com/reference/android/view/LayoutInflater.html` or `https://developer.android.com/reference/android/app/WallpaperManager.html` via `https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)`. |
| `https://developer.android.com/reference/androidx/annotation/Nullable` | Denotes that a parameter, field or method return value can be null. |
| `https://developer.android.com/reference/androidx/annotation/OpenForTesting` | Denotes that this class or method is only `open` to allow unit testing. |
| `https://developer.android.com/reference/androidx/annotation/OptIn` | Allows use of an opt-in API denoted by the given markers in the annotated file, declaration, or expression. |
| `https://developer.android.com/reference/androidx/annotation/PluralsRes` | Denotes that an integer parameter, field or method return value is expected to be a plurals resource reference. |
| `https://developer.android.com/reference/androidx/annotation/Px` | Denotes that an integer parameter, field or method return value is expected to represent a pixel dimension. |
| `https://developer.android.com/reference/androidx/annotation/RawRes` | Denotes that an integer parameter, field or method return value is expected to be a raw resource reference. |
| `https://developer.android.com/reference/androidx/annotation/ReplaceWith` | Specifies a code fragment that can be used to suggest a replacement for a method in conjunction with the `ReplaceWith` lint check. |
| `https://developer.android.com/reference/androidx/annotation/RequiresApi` | Denotes that the annotated element should only be called on the given Android API level or higher. |
| `https://developer.android.com/reference/androidx/annotation/RequiresExtension` | Denotes that the annotated element should only be called if the given extension is at least the given version. |
| `https://developer.android.com/reference/androidx/annotation/RequiresFeature` | Denotes that the annotated element requires one or more features. |
| `https://developer.android.com/reference/androidx/annotation/RequiresFlag` | Indicates an API is part of a feature that is guarded by an aconfig flag, and only available if the flag is enabled. |
| `https://developer.android.com/reference/androidx/annotation/RequiresOptIn` | Denotes that the annotated element is a marker of an opt-in API. |
| `https://developer.android.com/reference/androidx/annotation/RequiresPermission` | Denotes that the annotated element requires (or may require) one or more permissions. |
| `https://developer.android.com/reference/androidx/annotation/RequiresPermission.Read` | Specifies that the given permission is required for read operations. |
| `https://developer.android.com/reference/androidx/annotation/RequiresPermission.Write` | Specifies that the given permission is required for write operations. |
| `https://developer.android.com/reference/androidx/annotation/RestrictTo` | Denotes that the annotated element should only be accessed from within a specific scope (as defined by `https://developer.android.com/reference/androidx/annotation/RestrictTo.Scope`). |
| `https://developer.android.com/reference/androidx/annotation/ReturnThis` | Denotes that any overriding methods should `return this`. |
| `https://developer.android.com/reference/androidx/annotation/Size` | Denotes that the annotated element should have a given size or length. |
| `https://developer.android.com/reference/androidx/annotation/StringDef` | Denotes that the annotated String element, represents a logical type and that its value should be one of the explicitly named constants. |
| `https://developer.android.com/reference/androidx/annotation/StringRes` | Denotes that an integer parameter, field or method return value is expected to be a String resource reference (e.g. `android.R.string.ok`). |
| `https://developer.android.com/reference/androidx/annotation/StyleRes` | Denotes that an integer parameter, field or method return value is expected to be a style resource reference (e.g. `android.R.style.TextAppearance`). |
| `https://developer.android.com/reference/androidx/annotation/StyleableRes` | Denotes that an integer parameter, field or method return value is expected to be a styleable resource reference (e.g. `android.R.styleable.TextView_text`). |
| `https://developer.android.com/reference/androidx/annotation/TransitionRes` | Denotes that an integer parameter, field or method return value is expected to be a transition resource reference. |
| `https://developer.android.com/reference/androidx/annotation/UiContext` | Denotes a `https://developer.android.com/reference/android/content/Context.html` that can be used to create UI, meaning that it can provide a `https://developer.android.com/reference/android/view/Display.html` via `https://developer.android.com/reference/android/content/Context.html#getDisplay()` and can be used to obtain an instance of a UI-related service, such as `https://developer.android.com/reference/android/view/WindowManager.html`, `https://developer.android.com/reference/android/view/LayoutInflater.html` or `https://developer.android.com/reference/android/app/WallpaperManager.html` via `https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)`. |
| `https://developer.android.com/reference/androidx/annotation/UiThread` | Denotes that the annotated method or constructor should only be called on the UI thread. |
| `https://developer.android.com/reference/androidx/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. |
| `https://developer.android.com/reference/androidx/annotation/WorkerThread` | Denotes that the annotated method should only be called on a worker thread. |
| `https://developer.android.com/reference/androidx/annotation/XmlRes` | Denotes that an integer parameter, field or method return value is expected to be an XML resource reference. |

## Enums

|---|---|
| `https://developer.android.com/reference/androidx/annotation/InspectableProperty.ValueType` | **This enum is deprecated.** Replaced by the androidx.resourceinpsection package. |
| `https://developer.android.com/reference/androidx/annotation/RequiresOptIn.Level` | Severity of the diagnostic that should be reported on usages of opt-in API which did not explicitly accept the opt-in aspect of that API either by: |
| `https://developer.android.com/reference/androidx/annotation/RestrictTo.Scope` |   |