public class ArrayObjectAdapter
extends ObjectAdapter

   ↳ androidx.leanback.widget.ObjectAdapter
     ↳ androidx.leanback.widget.ArrayObjectAdapter

An ObjectAdapter implemented with an ArrayList.


Inherited constants

Public constructors

ArrayObjectAdapter(PresenterSelector presenterSelector)

Constructs an adapter with the given PresenterSelector.

ArrayObjectAdapter(Presenter presenter)

Constructs an adapter that uses the given Presenter for all items.


Constructs an adapter.

Public methods

void add(Object item)

Adds an item to the end of the adapter.

void add(int index, Object item)

Inserts an item into this adapter at the specified index.

void addAll(int index, Collection items)

Adds the objects in the given collection to the adapter, starting at the given index.

void clear()

Removes all items from this adapter, leaving it empty.

Object get(int index)

Returns the item for the given position.

int indexOf(Object item)

Returns the index for the first occurrence of item in the adapter, or -1 if not found.

boolean isImmediateNotifySupported()

Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise.

void move(int fromPosition, int toPosition)

Moved the item at fromPosition to toPosition.