maurycyw / StaggeredGridView

A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
https://github.com/maurycyw/StaggeredGridViewDemo
1.64k stars 664 forks source link

problem when used within fragment on the backstack #82

Open ddinger opened 10 years ago

ddinger commented 10 years ago

Im using the StaggeredGridView within a fragment. The initial rendering of the view works great. But if a register an OnItemClickListener and open some other fragment when the user selects an image, everytime I press the back button, I get the following exception

STACK_TRACE=java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at com.origamilabs.library.views.StaggeredGridView.populate(StaggeredGridView.java:963) at com.origamilabs.library.views.StaggeredGridView.onLayout(StaggeredGridView.java:917) at android.view.View.layout(View.java:14785) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055) at android.view.View.layout(View.java:14785) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14785) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14785) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:653

Any help appreciated, Regards, Dirk

ddinger commented 10 years ago

It seems that supporting the column change at runtime is not properly supported ?