RecyclerView﹕ No adapter attached; skipping layout

前端 未结 3 988
南旧
南旧 2020-12-03 19:00

I have been reading the different answers here on stackoverflow and on this blog post and tried to implement their solutions but I am still getting the error:

3条回答
  •  爱一瞬间的悲伤
    2020-12-03 19:42

    make sure you have set LayoutManager to RecyclerView. Hope it will help :)

    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    list.setLayoutManager(llm);
    list.setAdapter( adapter );
    

提交回复
热议问题