Search code examples
androidmvvmlistadapterandroid-livedata

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


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


Solution

  • 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.