# OnItemActivatedListener

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

*** ** * ** ***


```
public interface OnItemActivatedListener<K>
```

<br />

*** ** * ** ***

Register an OnItemActivatedListener to be notified when an item is activated (tapped or double clicked).

| Parameters |
|---|---|
| `<K>` | Selection key type. @see `https://developer.android.com/reference/androidx/recyclerview/selection/StorageStrategy` for supported types. |

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/recyclerview/selection/OnItemActivatedListener#onItemActivated(androidx.recyclerview.selection.ItemDetailsLookup.ItemDetails<K>,android.view.MotionEvent)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails<K> item, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/MotionEvent.html e )` Called when an item is "activated". |

## Public methods

### onItemActivated

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

```
abstract boolean onItemActivated(
    @NonNull ItemDetailsLookup.ItemDetails<K> item,
    @NonNull MotionEvent e
)
```

Called when an item is "activated". An item is activated, for example, when no selection exists and the user taps an item with her finger, or double clicks an item with a pointing device like a Mouse.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails<K> item` | details of the item. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/MotionEvent.html e` | the event associated with item. |

| Returns |
|---|---|
| `boolean` | true if the event was handled. |