sergejsha / pinned-section-listview

Easy to use ListView with pinned sections for Android.
2.59k stars 808 forks source link

Class cast exception in generateDefaultLayoutParams #58

Closed girishnair12345 closed 9 years ago

girishnair12345 commented 9 years ago

Hi,

I was trying to customise the PinnedListAdapter and I got ClassCastException, for line layoutParams = (LayoutParams) generateDefaultLayoutParams(); So I have changed it to layoutParams = (AbsListView.LayoutParams) new AbsListView.LayoutParams( AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT, 0);

And now it works fine, Is this a bug ?

sergejsha commented 9 years ago

Dy default PinnedSectionListView uses generateDefaultLayoutParams() of AbsListView, which is correct. If you change inheritance or override generateDefaultLayoutParams(), then it might break the implementation, which is expected consequence of such changes.