My app's main screen has a layout that uses two main layout pieces. There's an AbsoluteLayout (for buttons and background images) and a class that overrides SurfaceView, which handles custom animation stuff. (The animations are calculated based on application state, so I can't just put them in an animation resource).
My current problem is that the SurfaceView part of the layout sometimes loads before the AbsoluteLayout part, so I end up showing the user roughly half of the screen with the rest of it black; sometimes this lasts for over a second.
The solution I was thinking of is to set the whole layout to invisible in its layout file, and then call setVisibility(View.VISIBLE) on it after it is inflated. However, the layout resources are (apparently) loaded asynchronously, so if I set the layout to visible right after the call to inflate it, I still get the half-loaded problem sometimes.
Is anyone aware of a callback I can override to set things to visible once the layout is fully loaded?