Say I'm loading a list of different objects into a RecyclerView for the first time, then I'm calling onRefresh and reloading the data. The first time, there are no items so I think calling notifyItemChanged(position) will throw an exception? So do I need to first call notifyItemInserted(position) when the list is empty then once it is populated call notifyItemChanged(position)
The reason why I'm using notifyItemChanged instead of notifyDatasetChanged is because I need to add the list items one by one because they are all different types i.e .different viewholders.