Cause for NullPointerException android.support.v7.widget.RecyclerView.onMeasure

后端 未结 4 1201
北海茫月
北海茫月 2020-12-15 17:44

I am getting following Exception

01-27 11:15:15.756  18348-18348/com.example.pnimje.newswipelistview E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.Nu         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-15 17:53

    You need to verify that what you are sending to the adapter is not an empty List. I recommend you to either create the RecyclerView by code and add it later when you have the information, or to put an empty NULL object before passing it to the constructor of the adapter.

提交回复
热议问题