How can I tell when a Layout (and all its child Views) has fully finished inflating?

android, layout

Solution

You can override onFinishInflate() in your custom layout. This is called as the last phase of inflation, after all child views have been added.

Problem

I have a situation where I have a custom Layout which contains a bunch of children and which I inflate into a ViewFlipper. My problem is that the ViewFlipper badly stutters its animation as it tries to animate the Layout in, even as the Layout is still loading all its child Views. I tried using onLayout, but that gets called the moment the parent Layout is done inflating (it doesn't wait for the child views to inflate, so the stutter persists) I also tried onMeasure, but that's called dozens of times and keeps getting called every time anything in the Layout changes (such as the EditText getting focus, or changing value). So, I'm stumped... does *ANYTHING happen, that I can listen for, when the Layout is fully inflated, so that I can THEN tell the Flipper to perform the animation?

Original source