title: I'm adding data to my list but it doesn't appear in RecyclerView (Kotlin, MVVM)
body: <p>I am making a simple application. There are 2 screens in the application: List screen, Add screen.</p>
  <p>Scenario: When the application is opened, there is a list page on the screen. The user goes to the Adding page with the help of the Floating Action Button on the list page. Here, he enters the items with the help of Edit Text and comes to the List page by pressing the Add Button.</p>
  <p>I am using MVVM in this application and I am a beginner. So I can't find the problem. Here is the problem: I am adding new elements to my list in the Add Fragment, but these elements are not seems in the List Fragment.</p>
  <p>Thanks in advance.</p>
  <p>Model Class</p>
  <pre><code>data class Movie(
      val movieName: String,
      val releaseDate: String
  )
  </code></pre>
  <p>ViewModel class</p>
  <pre><code>class MovieViewModel : ViewModel() {
      val movies = MutableLiveData&lt;ArrayList&lt;Movie&gt;&gt;()
      var movieList = arrayListOf&lt;Movie&gt;()
  
      fun addMovie(movie: Movie) {
          movieList.add(movie)
          movies.value = movieList
      }
  }
  </code></pre>
  <p>Adapter Class</p>
  <pre><code>class MovieAdapter : RecyclerView.Adapter&lt;MovieAdapter.MyViewHolder&gt;() {
      private var movieList = emptyList&lt;Movie&gt;()
  
      class MyViewHolder(private val binding: RowItemBinding) :
          RecyclerView.ViewHolder(binding.root) {
          fun bind(movie: Movie) {
              binding.textViewMovieName.text = movie.movieName
              binding.textViewReleaseDate.text = movie.releaseDate
          }
      }
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
          val layoutInflater = LayoutInflater.from(parent.context)
          val binding = RowItemBinding.inflate(layoutInflater, parent, false)
          return MyViewHolder(binding)
      }
  
      override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
          val currentItem = movieList[position]
          holder.bind(currentItem)
      }
  
      override fun getItemCount(): Int {
          return movieList.size
      }
  
      fun setData(movie: List&lt;Movie&gt;) {
          val movieDiffUtil = MovieDiffUtil(movieList, movie)
          val movieDiffResult = DiffUtil.calculateDiff(movieDiffUtil)
          this.movieList = movie
          movieDiffResult.dispatchUpdatesTo(this)
      }
  }
  </code></pre>
  <p>Add Fragment</p>
  <pre><code>class AddFragment : Fragment() {
      private var _binding: FragmentAddBinding? = null
      private val binding get() = _binding!!
  
      private val movieViewModel: MovieViewModel by viewModels&lt;MovieViewModel&gt;()
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          _binding = FragmentAddBinding.inflate(inflater, container, false)
  
          binding.buttonAdd.setOnClickListener {
              insertData()
          }
  
          return binding.root
      }
  
      private fun insertData() {
          val movieName = binding.editTextMovieName.text.toString()
          val releaseDate = binding.editTextReleaseDate.text.toString()
          val movie = Movie(movieName, releaseDate)
          movieViewModel.addMovie(movie)
  
          findNavController().navigate(R.id.action_addFragment_to_listFragment)
      }
  
      override fun onDestroyView() {
          super.onDestroyView()
          _binding = null
      }
  }
  </code></pre>
  <p>List Fragment</p>
  <pre><code>class ListFragment : Fragment() {
      private var _binding: FragmentListBinding? = null
      private val binding get() = _binding!!
  
      private val adapter: MovieAdapter by lazy { MovieAdapter() }
      private val movieViewModel: MovieViewModel by viewModels&lt;MovieViewModel&gt;()
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          _binding = FragmentListBinding.inflate(inflater, container, false)
  
          setAdapter()
  
          movieViewModel.movies.observe(viewLifecycleOwner, { data -&gt;
              adapter.setData(data)
              binding.textView.setText(data.get(0).movieName)
          })
  
          binding.floatingActionButton.setOnClickListener {
              findNavController().navigate(R.id.action_listFragment_to_addFragment)
          }
  
  
          return binding.root
      }
  
      private fun setAdapter() {
          val recyclerView = binding.recyclerView
          recyclerView.adapter = adapter
          recyclerView.layoutManager = LinearLayoutManager(requireActivity())
      }
  
      override fun onDestroyView() {
          super.onDestroyView()
          _binding = null
      }
  }
  </code></pre>