How can display recycler view using fragment in android

前端 未结 2 532
野趣味
野趣味 2021-01-29 14:22

I want to display recycler view inside fragment but i am getting java.lang.NullPointerException: Attempt to invoke virtual method \'boolean android.support.v7.widget.Rec

2条回答
  •  终归单人心
    2021-01-29 14:44

    Try using:

    final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    

    I think your context is not passed in constructing linearlayoutmanager

提交回复
热议问题