I am working on a RecyclerView that retrieves some of the data from an Object, every time a new object is created that object will be added into SQLiteDatabase and then to my ViewModel MutableLiveData<ArrayList>. so my question is how can i set a method in my fragment that observes the changed array list of objects so that my recyclerview will automatically updated.
for MutableLiveData i have used the below method to Observe but its not working for ArrayList of objects in my case.
//this is an example
ViewModel.getChangedData().observe(requireActivity(),item->{
textview.setText(item);
please help, i am a beginner in this. i am using Java.
thanks in advance