# ContentView

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

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.CONSTRUCTOR])
  annotation ContentView
  ```

*** ** * ** ***

Annotation that can be attached to a constructor with a single `https://developer.android.com/reference/kotlin/androidx/annotation/LayoutRes` parameter to denote what layout the component intends to inflate and set as its content.

It is strongly recommended that components that support this annotation specifically call it out in their documentation.

```kotlin
public class MainFragment extends Fragment {
    public MainFragment() {
        // This constructor is annotated with @ContentView
        super(R.layout.main);
    }
}
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity.ComponentActivity` |   |
| `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.Fragment` |   |

## Summary

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

## Public constructors

### ContentView

android

```
ContentView()
```