Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RemoteResponse

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/widget/RemoteViews.RemoteResponse "View this page in Java")

```
open class RemoteResponse
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.widget.RemoteViews.RemoteResponse](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#) |

Class representing a response to an action performed on any element of a RemoteViews.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#RemoteResponse()()` <br /> |

| Public methods ||
|---|---|
| open [RemoteViews.RemoteResponse](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#) | `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#addSharedElement(kotlin.Int,%20kotlin.String)(viewId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, sharedElementName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Adds a shared element to be transferred as part of the transition between Activities using cross-Activity scene animations. |
| open static [RemoteViews.RemoteResponse](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#) | `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#fromFillInIntent(android.content.Intent)(fillIntent: https://developer.android.com/reference/kotlin/android/content/Intent.html#)` When using collections (eg. |
| open static [RemoteViews.RemoteResponse](https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#) | `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#fromPendingIntent(android.app.PendingIntent)(pendingIntent: https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#)` Creates a response which sends a pending intent as part of the response. |

## Public constructors

### RemoteResponse

```
RemoteResponse()
```

## Public methods

### addSharedElement

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun addSharedElement(
    viewId: Int, 
    sharedElementName: String
): RemoteViews.RemoteResponse
```

Adds a shared element to be transferred as part of the transition between Activities using cross-Activity scene animations. The position of the first element will be used as the epicenter for the exit Transition. The position of the associated shared element in the launched Activity will be the epicenter of its entering Transition.

| Parameters ||
|---|---|
| `viewId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The id of the view to be shared as part of the transition |
| `sharedElementName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The shared element name for this view. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#` | This value cannot be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/app/ActivityOptions.html#makeSceneTransitionAnimation(android.app.Activity,%20android.util.Pair)`

### fromFillInIntent

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun fromFillInIntent(fillIntent: Intent): RemoteViews.RemoteResponse
```

When using collections (eg. `https://developer.android.com/reference/kotlin/android/widget/ListView`, `https://developer.android.com/reference/kotlin/android/widget/StackView` etc.) in widgets, it is very costly to set PendingIntents on the individual items, and is hence not recommended. Instead a single PendingIntent template can be set on the collection, see `https://developer.android.com/reference/kotlin/android/widget/RemoteViews#setPendingIntentTemplate(kotlin.Int,%20android.app.PendingIntent)`, and the individual on-click action of a given item can be distinguished by setting a fillInIntent on that item. The fillInIntent is then combined with the PendingIntent template in order to determine the final intent which will be executed when the item is clicked. This works as follows: any fields which are left blank in the PendingIntent template, but are provided by the fillInIntent will be overwritten, and the resulting PendingIntent will be used. The rest of the PendingIntent template will then be filled in with the associated fields that are set in fillInIntent. See `https://developer.android.com/reference/kotlin/android/content/Intent.html#fillIn(android.content.Intent,%20kotlin.Int)` for more details. Creates a response which sends a pending intent as part of the response. The source bounds (`https://developer.android.com/reference/kotlin/android/content/Intent.html#getSourceBounds()`) of the intent will be set to the bounds of the target view in screen space. Note that any activity options associated with the mPendingIntent may get overridden before starting the intent.

| Parameters ||
|---|---|
| `fillIntent` | [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#): The intent which will be combined with the parent's PendingIntent in order to determine the behavior of the response. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#` | This value cannot be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/widget/RemoteViews#setPendingIntentTemplate(kotlin.Int,%20android.app.PendingIntent)`
- `https://developer.android.com/reference/kotlin/android/widget/RemoteViews#setOnClickFillInIntent(kotlin.Int,%20android.content.Intent)`

### fromPendingIntent

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun fromPendingIntent(pendingIntent: PendingIntent): RemoteViews.RemoteResponse
```

Creates a response which sends a pending intent as part of the response. The source bounds (`https://developer.android.com/reference/kotlin/android/content/Intent.html#getSourceBounds()`) of the intent will be set to the bounds of the target view in screen space. Note that any activity options associated with the mPendingIntent may get overridden before starting the intent.

| Parameters ||
|---|---|
| `pendingIntent` | [PendingIntent](https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#): The `https://developer.android.com/reference/kotlin/android/app/PendingIntent.html#` to send as part of the response. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/RemoteViews.RemoteResponse#` | This value cannot be `null`. |