Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,

前端 未结 8 1860
灰色年华
灰色年华 2020-12-01 08:54

my RecyclerView do not call onCreateViewHolder, onBindViewHolder, therefore, does not appear nothing in recyclerview. I put logs for debugging, and no log is shown. What can

8条回答
  •  失恋的感觉
    2020-12-01 09:23

    Might have been a different case but for me I just forgot to set the Layout Manager as follows:

    LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    recycler.setLayoutManager(layoutManager);
    

    Hope it helps :)

提交回复
热议问题