Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

OnChildAttachStateChangeListener

interface OnChildAttachStateChangeListener
androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener

A Listener interface that can be attached to a RecylcerView to get notified whenever a ViewHolder is attached to or detached from RecyclerView.

Summary

Public methods

abstract Unit

Called when a view is attached to the RecyclerView.

abstract Unit

Called when a view is detached from RecyclerView.

Public methods

onChildViewAttachedToWindow

abstract fun onChildViewAttachedToWindow(@NonNull view: View): Unit

Called when a view is attached to the RecyclerView.

Parameters
view View: The View which is attached to the RecyclerView

onChildViewDetachedFromWindow

abstract fun onChildViewDetachedFromWindow(@NonNull view: View): Unit

Called when a view is detached from RecyclerView.

Parameters
view View: The View which is being detached from the RecyclerView