title: Android Kotlin RecyclerView Adapter onCreateViewHolder no called
body: <p>This is my adapter creation.</p>
  <pre><code>        groupsAdapter = GroupsAdapter(groupsVM)
          groupsRecyclerView.apply {
              // use this setting to improve performance if you know that changes
              // in content do not change the layout size of the RecyclerView
              setHasFixedSize(false)
              // specify an viewAdapter
              adapter = groupsAdapter
              // use a linear layout manager
              layoutManager = LinearLayoutManager(context)
          }
  </code></pre>
  <p>Then I set a listener of the viewmodel</p>
  <pre><code>       groupsVM.groupNames.observe(viewLifecycleOwner , Observer {
              groupsAdapter.setData(it)
          })
  </code></pre>
  <p>Above code is in the  view.</p>
  <p>Then, this is my adapter class</p>
  <pre><code>class GroupsAdapter()
      : RecyclerView.Adapter&lt;GroupsAdapter.MyViewHolder&gt;(){
  
      private var dataList = emptyList&lt;Pair&lt;String, String&gt;&gt;()
  
      fun setData(groupNameList: List&lt;Pair&lt;String, String&gt;&gt;){
          dataList = groupNameList
          notifyDataSetChanged()
      }
  
      class MyViewHolder(private val view: View) :
          RecyclerView.ViewHolder(view){
  
          val groupView = itemView.findViewById&lt;TextView&gt;(R.id.group_view) as View
          val groupNameTextView = itemView.findViewById&lt;TextView&gt;(R.id.group_name) as TextView
      }
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
              MyViewHolder {
          // create a new view
          val view = LayoutInflater.from(parent.context).
              inflate(R.layout.group, parent, false) as View
          return MyViewHolder(view)
      }
  
      override fun getItemCount(): Int {
          return dataList.size
      }
  
      override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
          val group = dataList[position]
          if (group != null) {
              holder.groupNameTextView.text = group.second
          }
      }
  
  }
  </code></pre>
  <p>When getItemCount is called and return a positive value and I also expect onCreateViewHolder to be called as well.
  But onCreateViewHolder is never called.
  Can you help me?
  Thanks a lot!</p>