public static class RecyclerView.RecycledViewPool
extends Object

   ↳ androidx.recyclerview.widget.RecyclerView.RecycledViewPool

RecycledViewPool lets you share Views between multiple RecyclerViews.

If you want to recycle views across RecyclerViews, create an instance of RecycledViewPool and use RecyclerView.setRecycledViewPool(RecycledViewPool).

RecyclerView automatically creates a pool for itself if you don't provide one.


Public constructors


Public methods

void clear()

Discard all ViewHolders.

RecyclerView.ViewHolder getRecycledView(int viewType)

Acquire a ViewHolder of the specified type from the pool, or null if none are present.

int getRecycledViewCount(int viewType)

Returns the current number of Views held by the RecycledViewPool of the given view type.

void putRecycledView(RecyclerView.ViewHolder scrap)

Add a scrap ViewHolder to the pool.

void setMaxRecycledViews(int viewType, int max)

Sets the maximum number of ViewHolders to hold in the pool before discarding.

Inherited methods

Public constructors


public RecycledViewPool ()

Public methods