# OnReceiveContentViewBehavior

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/OnReceiveContentViewBehavior.java+class:androidx.core.view.OnReceiveContentViewBehavior) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

*** ** * ** ***


```
public interface OnReceiveContentViewBehavior
```

<br />

Known direct subclasses [AppCompatEditText](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatEditText)

|---|---|
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatEditText` | A `https://developer.android.com/reference/android/widget/EditText.html` which supports compatible features on older versions of the platform, including: |

Known indirect subclasses [EmojiAppCompatEditText](https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatEditText), [GuidedActionAppCompatEditText](https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText)

|---|---|
| `https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatEditText` | AppCompatEditText widget enhanced with emoji capability by using `https://developer.android.com/reference/androidx/emoji/widget/EmojiEditTextHelper`. |
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText` | A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment. |

*** ** * ** ***

Interface for widgets to implement default behavior for receiving content. Content may be both text and non-text (plain/styled text, HTML, images, videos, audio files, etc).

Widgets should implement this interface to define the default behavior for receiving content when the SDK is \<= 30. When doing so, widgets should also override `https://developer.android.com/reference/android/view/View.html#onReceiveContent(android.view.ContentInfo)` for SDK \>30.

Apps wishing to provide custom behavior for receiving content should not implement this interface but rather set a listener via `https://developer.android.com/reference/androidx/core/view/ViewCompat#setOnReceiveContentListener(android.view.View,java.lang.String[],androidx.core.view.OnReceiveContentListener)`. See `https://developer.android.com/reference/androidx/core/view/ViewCompat#performReceiveContent(android.view.View,androidx.core.view.ContentInfoCompat)` for more info.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat` | `https://developer.android.com/reference/androidx/core/view/OnReceiveContentViewBehavior#onReceiveContent(androidx.core.view.ContentInfoCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat payload)` Implements a view's default behavior for receiving content. |

## Public methods

### onReceiveContent

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
abstract @Nullable ContentInfoCompat onReceiveContent(@NonNull ContentInfoCompat payload)
```

Implements a view's default behavior for receiving content.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat payload` | The content to insert and related metadata. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat` | The portion of the passed-in content that was not handled (may be all, some, or none of the passed-in content). |