I'm facing issue in Collectionview after implementing as staggeredgridlayoutmanager as given below"
Java.Lang.ArrayIndexOutOfBoundsException: 'length=4; index=36'
Note: "index=36" in the error may vary depending upon scroll position and "length=4" in the error statement i think are the number of visible items at any time in collectionview.
My Assumptions:
I think the error mentioned above always occurs when i reach to the end of collectionview and collectionview try to load more items. This is only happens when i fastely scroll collectionview and if i scroll normally then all is working well.
As for as i know, the think that is causing the problem is the layout measuring process after adding more items to the collectionview at reaching to the bottom of it and in that duration if i continue to scroll while collectionview is busy to measure the layout, then it will throw an exception as mentioned above.
And i think if i'm able to detect layout measuring process and stop further user scroll at that time, then i can solve the problem but the question is that is there anything exposed by collectionview or even at platform specific level (In my case android) to know that Layout Measuring processed is being performed If i'm wrong, please someone can give me solution to solve that problem!