# DisplayContext

Artifact: [androidx.annotation:annotation](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/DisplayContext.jvm.kt+class:androidx.annotation.DisplayContext) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.3.0)

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  @Retention(value = AnnotationRetention.SOURCE)
  @Target(allowedTargets = [AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD])
  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()`. Note: it is not considered to be a UI or visual Context and **must not** be used to obtain UI-related services, 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;)`. If the UI services mentioned above are required, instead please use Contexts which are marked as `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext`.

`https://developer.android.com/reference/android/app/Activity.html`, Context instances created with `https://developer.android.com/reference/android/content/Context.html#createWindowContext(android.view.Display, int, android.os.Bundle)` or `https://developer.android.com/reference/android/content/Context.html#createDisplayContext(android.view.Display)` can be used to get an associated `https://developer.android.com/reference/android/view/Display.html` instance.

This is a marker annotation and has no specific attributes.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html#getDisplay()` |   |
| `https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)` |   |
| `https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)` |   |
| `https://developer.android.com/reference/android/content/Context.html#createDisplayContext(android.view.Display)` |   |
| `https://developer.android.com/reference/android/content/Context.html#createWindowContext(android.view.Display, int, android.os.Bundle)` |   |
| `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` |   |

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/DisplayContext#DisplayContext()()` | android |

## Public constructors

### DisplayContext

android

```
DisplayContext()
```