# RecyclerView.RecyclerListener

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

*** ** * ** ***


```
public interface RecyclerView.RecyclerListener
```

<br />

*** ** * ** ***

A RecyclerListener can be set on a RecyclerView to receive messages whenever a view is recycled.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView#setRecyclerListener(androidx.recyclerview.widget.RecyclerView.RecyclerListener)` |   |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.RecyclerListener#onViewRecycled(androidx.recyclerview.widget.RecyclerView.ViewHolder)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder holder)` This method is called whenever the view in the ViewHolder is recycled. |

## Public methods

### onViewRecycled

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

```
abstract void onViewRecycled(@NonNull RecyclerView.ViewHolder holder)
```

This method is called whenever the view in the ViewHolder is recycled. RecyclerView calls this method right before clearing ViewHolder's internal data and sending it to RecycledViewPool. This way, if ViewHolder was holding valid information before being recycled, you can call `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder#getBindingAdapterPosition()` to get its adapter position.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder holder` | The ViewHolder containing the view that was recycled |