【问题标题】:I am getting this error when i try to find a RecyclerView by id当我尝试通过 id 查找 RecyclerView 时出现此错误
【发布时间】:2022-01-06 14:33:14
【问题描述】:

enter image description hereprivate lateinit var recv:RecyclerView

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    recv = findViewById<RecyclerView>(R.id.mRecycler)

【问题讨论】:

  • 将光标悬停在它上面,它会显示解释问题的错误消息。

标签: android-studio kotlin android-recyclerview


【解决方案1】:

确保您导入以下内容:

import androidx.recyclerview.widget.RecyclerView

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-09
    • 1970-01-01
    • 2023-01-17
    • 2021-03-30
    • 1970-01-01
    • 2021-08-25
    • 2016-05-14
    • 1970-01-01
    相关资源
    最近更新 更多