how to get the list of ListAdapter<Model,ViewHolder::class>
Asked Answered
P

1

6

is there anyway posible to get the list of items inside my listadapter, cause the only method to access the list is submitList()

Parterre answered 9/4, 2019 at 23:33 Comment(0)
U
15

Call getCurrentList(). Quoting the docs:

Get the current List - any diffing to present this list has already been computed and dispatched via the ListUpdateCallback. If a null List, or no List has been submitted, an empty list will be returned.

Ungotten answered 9/4, 2019 at 23:51 Comment(3)
class DevicesSavedAdapter : ListAdapter<GetDevicesResponse,DevicesSavedAdapter.DeviceSavedHolder>(DIFF_CALLBACK) { fun testGetList(){ getCurrentList() this.getCurrentList() } unresolved referenceParterre
@EderPadilla: Are you using androidx.recyclerview.widget.ListAdapter, and are you on the latest version?Ungotten
you were right ! i was ussing 1.0.0 and I change it to 1.1.0-alpha05 thanks a lot 😬Parterre

© 2022 - 2024 — McMap. All rights reserved.