Open raeesaa opened 11 years ago
i have exactly same exception
I am no longer using this repository. Could not resolve the issue.
For anyone still having this issue, I just encountered it and found a solution for myself. Look at this StackOverflow: https://stackoverflow.com/questions/17882123/android-grid-view-with-images-and-sub-text-issue
When converting my existing code from using a GridView to a TwoWayGridView, I had had this bit of code in my adapter's getView() function:
imageView.setLayoutParams(new GridView.LayoutParams(85,85));
I had to make sure it was changed to:
imageView.setLayoutParams(new TwoWayGridView.LayoutParams(85,85));
In short, the issue happens when trying to do setLayoutParams() on the wrong kind of LayoutParams object.
Thanks @DanAndersen!
I am trying to use two way GridView in my project. I have created my own custom adapter for GridView. When I tried running application, I got following exception :
java.lang.ClassCastException: android.widget.AbsListView$LayoutParams cannot be cast to com.jess.ui.TwoWayAbsListView$LayoutParams at com.jess.ui.TwoWayGridView$HorizontalGridBuilder.onMeasure(TwoWayGridView.java:2872)
Is it because I am using my own custom adapter?