RecyclerView.RecyclerListener


public interface RecyclerView.RecyclerListener


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

Summary

Public methods

abstract void

This method is called whenever the view in the ViewHolder is recycled.

Public methods

onViewRecycled

Added in 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 getBindingAdapterPosition to get its adapter position.

Parameters
@NonNull RecyclerView.ViewHolder holder

The ViewHolder containing the view that was recycled