What I want to know is, if I set an adapter to a recyclerview like this:
mRecyclerView.setAdapter(new myRecyclerAdapter(mCustomObject.getDataSet()));
Can I update the dataset and notify the adapter like this?
mCustomObject.getDataSet().add(XPTO);
myRecyclerAdapter.notifyDataSetChanged();
Or do I need to get the dataset inside the adapter?
Thanks in advance!
If mCustomObject.getDataSet()
always returns the same object and doesn't create a new one, that should be enough. If it returns a new object every time, then the adapter has no way of updating the values to display.