# ItemList.OnSelectedListener

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/ItemList.java+class:androidx.car.app.model.ItemList.OnSelectedListener) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
public interface ItemList.OnSelectedListener
```

<br />

*** ** * ** ***

A listener for handling selection events for lists with selectable items.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/ItemList.Builder#setOnSelectedListener(androidx.car.app.model.ItemList.OnSelectedListener)` |   |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/car/app/model/ItemList.OnSelectedListener#onSelected(int)(int selectedIndex)` Notifies that an item was selected. |

## Public methods

### onSelected

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

```
abstract void onSelected(int selectedIndex)
```

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 newly selected item |