if due to stupidity of programmer the adapter is requesting a view to be displayed in an invalid position i.e. position > getCount() == true the method returns null and passes the issue to other places in the system
In my case, there was a location in which I forgot to call notifyDatasetInvalidated() when the adapter cleared the data and scrolling in the invalid list wold cause an issue in android.widget.HeaderViewListAdapter.isEnabled instead of throwing it in the initial getView.
I suggest adding a validation of position and an exception instead of returning null and letting the system crash.
if due to stupidity of programmer the adapter is requesting a view to be displayed in an invalid position i.e.
position > getCount() == truethe method returns null and passes the issue to other places in the systemIn my case, there was a location in which I forgot to call
notifyDatasetInvalidated()when the adapter cleared the data and scrolling in the invalid list wold cause an issue inandroid.widget.HeaderViewListAdapter.isEnabledinstead of throwing it in the initial getView.I suggest adding a validation of position and an exception instead of returning null and letting the system crash.