Android 12 Developer Preview is here! Try it out, and give us your feedback!


open class CursorObjectAdapter : ObjectAdapter
   ↳ androidx.leanback.widget.ObjectAdapter
   ↳ androidx.leanback.widget.CursorObjectAdapter

An ObjectAdapter implemented with a Cursor.


Inherited constants
Public constructors
<init>(presenterSelector: PresenterSelector!)

Constructs an adapter with the given PresenterSelector.

<init>(presenter: Presenter!)

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

Constructs an adapter.

Public methods
open Unit
changeCursor(cursor: Cursor!)

Changes the underlying cursor to a new cursor.

open Unit

Closes this adapter, closing the backing Cursor as well.

open Any!
get(index: Int)


Returns the Cursor backing the adapter.


Returns the CursorMapper used to convert Cursor rows into Objects.

open Boolean

Returns true if the adapter, and hence the backing Cursor, is closed; false otherwise.

open Boolean


Sets the CursorMapper used to convert Cursor rows into Objects.

open Int

open Cursor!
swapCursor(cursor: Cursor!)

Swap in a new Cursor, returning the old Cursor.

Protected methods

Removes an item from the cache.

invalidateCache(index: Int, count: Int)

Removes count items starting at index.

open Unit

Called whenever the cursor changes.

open Unit

Called when setMapper(CursorMapper) is called and a different mapper is provided.

Inherited functions