Also, since the parent is null, it is impossible to instantiate a LayoutInflater simply by calling LayoutInflater.from(parent.getContext()). One workaround for this is to pass a context when creating the adapter, and then getting the inflater from that context.
The method
in the
SectionAdapter
class is always called withconvertView
andparent
asnull
.From HeaderListView.java line 262:
This way, we cannot reuse inflated headers.
Also, since the parent is
null
, it is impossible to instantiate aLayoutInflater
simply by callingLayoutInflater.from(parent.getContext())
. One workaround for this is to pass a context when creating the adapter, and then getting the inflater from that context.