Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
minlite opened this issue Aug 8, 2014 · 3 comments

Comments

@minlite
Copy link

minlite commented Aug 8, 2014

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

@blundell
Copy link

notifyDataSetChanged() on your adapter

@zonkzen
Copy link

zonkzen commented Dec 1, 2014

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

@mrdjohnson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants