title: lateinit property adapter has not been initialized setting up RecyclerView with Fragment
body: <p>I have a problem adapting a RecyclerView to a fragment. I have a Navigation Drawer, which in turn has a TabLayout, and when I click on a Tab it takes me to this RecyclerView. I have no way to adapt it, now I get the error of "lateinit property adapter has not been initialized", but I tried a thousand different ways.</p>
  
  <blockquote>
    <p>MainAdapter.kt</p>
  </blockquote>
  
  <pre><code>class MainAdapter(private val context: Context) : RecyclerView.Adapter&lt;MainAdapter.MainViewHolder&gt;() 
  {
  
  private var dataList = mutableListOf&lt;Usuario&gt;()
  
  fun setListData(data:MutableList&lt;Usuario&gt;){
      dataList = data
  }
  
  override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MainViewHolder {
      val view = LayoutInflater.from(context).inflate(R.layout.item_row, parent, false)
      return MainViewHolder(view)
  }
  
  override fun getItemCount(): Int {
      return if(dataList.size &gt; 0){
          dataList.size
      }else{
          0
      }
  }
  
  override fun onBindViewHolder(holder: MainViewHolder, position: Int) {
      val user = dataList[position]
      holder.bindView(user)
  }
  
  inner class MainViewHolder(itemView: View): RecyclerView.ViewHolder(itemView){
  
      fun bindView(user: Usuario){
          Glide.with(context).load(user.imageUrl).into(itemView.circleImageView)
          itemView.txt_title.text = user.nombre
          itemView.txt_desc.text = user.descripcion 
      }
  
  }
  }
  </code></pre>
  
  <blockquote>
    <p>FragmentNotification.kt</p>
  </blockquote>
  
  <pre><code>class NotificacionesFragment : Fragment(){
  
  private lateinit var adapter: MainAdapter
  private lateinit var _view: View
  private lateinit var rv: RecyclerView
  
  
  override fun onCreateView(
      inflater: LayoutInflater,
      container: ViewGroup?,
      savedInstanceState: Bundle?
  ): View? {
      _view = inflater.inflate(R.layout.notificaciones, container, false)
     // val viewPager = x.findViewById&lt;View&gt;(R.id.viewPager) as ViewPager
      rv = _view.findViewById(R.id.rv) as RecyclerView
  
      rv.adapter = MainAdapter (requireContext())
  
      _view.rv.layoutManager = LinearLayoutManager(requireContext())
      _view.rv.adapter = adapter
  
      val dummyList = mutableListOf&lt;Usuario&gt;()
      dummyList.add(Usuario("lala","lala","lala"))
  
      adapter.setListData(dummyList)
      adapter.notifyDataSetChanged()
  
      return _view
  }
  }
  </code></pre>