Search code examples
javaandroidkotlinandroid-layoutandroid-view

ConstraintLayout cannot be cast to RecyclerView


    val rvMaps = findViewById<RecyclerView>(R.id.rvMaps)
    // Set layout manager on the recycler
    rvMaps.layoutManager = LinearLayoutManager(this)

How can I solve the problem?


Solution

  • Sorrry now it's fine I gave the Constraint Layout the id rvMaps and not the recyclerview