title: This error occur to me E/RecyclerView: No adapter attached; skipping layout
body: <p>I get that my <code>layoutManager</code> and <code>adapter</code> seem to be null but i don't quite get why is it null.</p>
  
  <p>here is the code for my <code>GpsFragment.kt</code></p>
  
  <pre><code>class GpsFragment : Fragment() {
  
  override fun onCreateView(
      inflater: LayoutInflater,
      container: ViewGroup?,
      savedInstanceState: Bundle?
  ): View? {
      (context as AppCompatActivity).supportActionBar!!.title = "Gps"
      val root = inflater.inflate(R.layout.fragment_gps, container, false)
  
          showCars()
  
      return root
  }
  
  private fun showCars(){
      val cars = listOf(
          Cars("Bezza","0.17263","3.267834"),
          Cars("Bezza","0.17263","3.267834"),
          Cars("Bezza","0.17263","3.267834"),
          Cars("Bezza","0.17263","3.267834")
      )
  
      myCarlist?.layoutManager = LinearLayoutManager(activity)
      myCarlist?.adapter = CarAdapter(cars)
  }
  </code></pre>
  
  <p>Here is the code for my model class <code>Cars.kt</code></p>
  
  <pre><code>data class Cars(val name: String = "-",
              val latitude: String = "-",
              val longtitude: String = "-")
  </code></pre>
  
  <p>And this the code for my adapter <code>CarAdapter.kt</code></p>
  
  <pre><code>class CarAdapter (private val cars : List&lt;Cars&gt;) : RecyclerView.Adapter&lt;CarAdapter.CarViewHolder&gt;(){
  
  override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CarViewHolder {
      val inflater = LayoutInflater.from(parent.context).inflate(R.layout.list_layout, parent, false)
  
      return  CarViewHolder(inflater)
  }
  
  override fun getItemCount() = cars.size
  
  override fun onBindViewHolder(holder: CarViewHolder, position: Int) {
      val car = cars[position]
  
      holder.view.carname.text = car.name
      holder.view.latitude.text = car.latitude
      holder.view.longtitude.text = car.longtitude
  
  }
  
  class CarViewHolder(val view:View) : RecyclerView.ViewHolder(view)
  </code></pre>
  
  <p>}</p>