There's a lot of questions on this problem, but most are too specialized to answer my question.
I have a GoogleMap
which I tell to fit its camera to certain bounds. Perhaps not very surprisingly, I get an error:
java.lang.IllegalStateException: Map size should not be 0. Most likely, layout has not yet occured for the map view.
So let's abstract this problem to any View
.
When does this 'layout' event actually take place? onMeasure()
doesn't show up in the Activity Lifecycle, for example. When is it safe to call my layout-needing method?