recyclerview No adapter attached; skipping layout

后端 未结 30 3952
走了就别回头了
走了就别回头了 2020-11-21 04:51

Just implemented RecyclerView in my code, replacing ListView.

Everything works fine. The data is displayed.

But error messages are

30条回答
  •  清歌不尽
    2020-11-21 05:29

    In Kotlin we had this weird illogical issue.

    This didn't work:

     mBinding.serviceProviderCertificates.apply {
                adapter = adapter
                layoutManager =  LinearLayoutManager(activity)
            }
    

    While this worked:

    mBinding.serviceProviderCertificates.adapter = adapter
    mBinding.serviceProviderCertificates.layoutManager = LinearLayoutManager(activity)
    

    Once I get more after work hours, I will share more insights.

提交回复
热议问题