drakeet / MultiType

Flexible multiple types for Android RecyclerView.
Apache License 2.0
5.76k stars 751 forks source link

List<?> items 空指针异常?已经在onCreate()时初始化List并设置了setItems() #169

Closed hero0812 closed 7 years ago

hero0812 commented 7 years ago

FATAL EXCEPTION: main Process: com.binbin.university, PID: 31510 java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference at me.drakeet.multitype.MultiTypeAdapter.getItemCount(MultiTypeAdapter.java:240) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3493) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3310) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844) at android.view.View.layout(View.java:16021) at android.view.ViewGroup.layout(ViewGroup.java:5181) at com.binbin.university.view.anythingPullLayout.AnythingPullLayout.layoutSelf(AnythingPullLayout.java:259) at com.binbin.university.view.anythingPullLayout.AnythingPullLayout.onLayout(AnythingPullLayout.java:240) at android.view.View.layout(View.java:16021)

drakeet commented 7 years ago

你好,这看起来是你代码有问题,请提供相关代码和复现程序。

drakeet commented 7 years ago

We are closing this issue as we don't have enough actionable information. If you are still facing this problem, please open a new issue and add the relevant information along with reference to the earlier issue.