# OnItemActivatedListener

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/recyclerview/selection/OnItemActivatedListener "View this page in Java")

<br />

```
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[StorageStrategy](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/StorageStrategy)for supported types. |

## Summary

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [onItemActivated](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/OnItemActivatedListener#onItemActivated(androidx.recyclerview.selection.ItemDetailsLookup.ItemDetails<K>,android.view.MotionEvent))`(item: `[ItemDetailsLookup.ItemDetails](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails)`<K!>, e: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`)` Called when an item is "activated". |

## Public functions

### onItemActivated

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

```
fun onItemActivated(item: ItemDetailsLookup.ItemDetails<K!>, e: MotionEvent): Boolean
```

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                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| `item: `[ItemDetailsLookup.ItemDetails](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails)`<K!>` | details of the item.            |
| `e: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)                                                                   | the event associated with item. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the event was handled. |