ViewModel onCleared not called in RecyclerView
I have an adapter with code below. The problem is, that the onCleared()-Method of the ViewModel seems never being called for the ViewModels for the list items.
Is there a special method / flag that needs to be set to clear these ViewModels?
class BaseRecyclerViewViewModelAdapter(
private val lifecycleOwner: LifecycleOwner
) : RecyclerView.Adapter() {
var items: List = emptyList()
set(value) {
field = value
notifyDataSetChanged()
}...