# OnSelectedDelegate

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/OnSelectedDelegate.java+class:androidx.car.app.model.OnSelectedDelegate) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public interface OnSelectedDelegate
```

<br />

*** ** * ** ***

A host-side delegate for sending `https://developer.android.com/reference/androidx/car/app/model/ItemList.OnSelectedListener` events to the car app.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/car/app/model/OnSelectedDelegate#sendSelected(int,androidx.car.app.OnDoneCallback)(int selectedIndex, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/OnDoneCallback callback)` Notifies that an item was selected. |

## Public methods

### sendSelected

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
abstract void sendSelected(int selectedIndex, @NonNull OnDoneCallback callback)
```

Notifies that an item was selected.

This event is called even if the selection did not change, for example, if the user selected an already selected item.

| Parameters |
|---|---|
| `int selectedIndex` | the index of the selected item |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/OnDoneCallback callback` | the `https://developer.android.com/reference/androidx/car/app/OnDoneCallback` to trigger when the client finishes handling the event |