title: Android Jetpack: RecyclerView is not updating when LiveData is set
body: <p>So I have a simple implementation to display a list of users in a <code>RecyclerView</code>, and the list is queried in a <code>ViewModel</code> as <a href="https://developer.android.com/reference/android/arch/lifecycle/LiveData" rel="noreferrer"><code>LiveData</code></a>. </p>
  
  <p>The problem is that the UI is not updated to show the latest list - called <code>users</code> - even when the list is observed. I just set up a list of demo users for now.</p>
  
  <p>Here's my ViewModel:</p>
  
  <pre><code>class MainViewModel : ViewModel() {
  
      private val demoData = listOf(
              User(userName = "Bob", favoriteColor = "Green"),
              User(userName = "Jim", favoriteColor = "Red"),
              User(userName = "Park", favoriteColor = "Blue"),
              User(userName = "Tom", favoriteColor = "Yellow"),
              User(userName = "Lee", favoriteColor = "Black"),
              User(userName = "Xiu", favoriteColor = "Gray")
      )
  
      private val _users = MutableLiveData&lt;List&lt;User&gt;&gt;()
      val users: LiveData&lt;List&lt;User&gt;&gt;
          get() = _users
  
      init {
          _users.value = listOf()
      }
  
      fun loadUsers() {
          _users.value = demoData.toMutableList().apply { shuffle() }
      }
  }
  </code></pre>
  
  <p>And my ViewModel's attached Fragment:</p>
  
  <pre><code>// ...
  
  override fun onActivityCreated(savedInstanceState: Bundle?) {
      super.onActivityCreated(savedInstanceState)
      viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
  
      viewModel.users.observe(this, Observer {
          mAdapter.notifyDataSetChanged()
      })
  
      mAdapter = UsersAdapter(viewModel.users.value!!)
  
      mainRV = view?.findViewById&lt;RecyclerView&gt;(R.id.rv_main)?.apply {
          adapter = mAdapter
          layoutManager = LinearLayoutManager(view?.context)
      }
  
      viewModel.loadUsers()
  }
  </code></pre>
  
  <p>P.S. the <code>UsersAdapter</code> is a usual <code>RecyclerView.Adapter</code>.</p>
  
  <p>I have made sure to call <code>setValue</code> on my users list to call the Observer, thus I am not sure what is missing here. Is my adapter wrongly setup? </p>