truizlop / SectionedRecyclerView

An adapter to create Android RecyclerViews with sections, providing headers and footers.
806 stars 144 forks source link

Nullpointer when set section count from list size #3

Closed pratamawijaya closed 9 years ago

pratamawijaya commented 9 years ago

Hi im trying set section count using list size, but always give me null pointer, i have been trace my code, and im sure my arraylist not null, here are my adapter

_Adapter_ https://gist.github.com/anonymous/fd7d7b0a5ee22532f626

_my MainActivity_ https://gist.github.com/anonymous/6767cbd484bbd4145487

_my MainPresenter_ https://gist.github.com/anonymous/2f6c4e4bde3cb4e16dab

pratamawijaya commented 9 years ago

then i have changed my adapter become like these

https://gist.github.com/anonymous/31781b2426fc6b81984f

and its work ~_~ but im still didn't get it why in first method is throwing null pointer

humazed commented 9 years ago

I have the same problem here. getItemCountForSection method called before constructor. so the fields is null.