AndroidStaggeredGrid icon indicating copy to clipboard operation
AndroidStaggeredGrid copied to clipboard

How to force the grid to redraw when handling configuration changes manually?

Open minlite opened this issue 10 years ago • 3 comments

I'm loading a lot of data in my StaggeredGridView and reloading it after a configuration change (i.e orientation change) would take a long time. So I have marked to handle the orientation change myself.

When the orientation is changed from portrait to landscape while displaying a 2 column grid, the columns overlap each other. I believe it is because the view is not remeasuring and redrawing the layout.

How can I force measure and draw the StaggeredGridView in my onConfigurationChanged method?

I have tried using requestLayout(), invalidate(), and forceLayout() but none of them seems to solve my issue.

Thanks

minlite avatar Aug 08 '14 06:08 minlite

notifyDataSetChanged() on your adapter

blundell avatar Aug 11 '14 13:08 blundell

@minlite @blundell Have you solved this issue? calling notifyDataSetChanged() does nothing...

zonkzen avatar Dec 01 '14 20:12 zonkzen

For any future people, or anyone still wondering about this, hopefully this will help? : http://stackoverflow.com/questions/4438128/how-to-refresh-a-gridview

mrdjohnson avatar Sep 03 '15 00:09 mrdjohnson