[here's my code ][1]
[1]: https://i.stack.imgur.com/uoq`val recyclerView = findViewById(R.id.recyclerView) recyclerView.layoutManager=LinearLayoutManager(this) `xi.png
CodePudding user response:
You have to infer the correct type for the findViewById
method, otherwise the recyclerview
variable will be a generic View
and not a RecyclerView
val recyclerView = findViewById<RecyclerView>(R.id.recyclerView)