Layout display error when returning from onPause
===

I have a layout which includes a GLSurfaceView which takes up the whole screen. At the bottom of the screen, I have a semi-transparent toolbar (LinearLayout) which overlays the GLSurfaceView.
Also, my app is full screen (`android:theme="@android:style/Theme.NoTitleBar.Fullscreen`).

Usually, everything is fine, but starting with ICS, whenever the user comes back to the app (returning from `onPause`), the OS plays a quick animation where the app starts with the Android status bar showing at the top and the app screen pushed down. Then the status bar disappears and the app's screen moves up by that much to get to its normal full screen position.

When this animation completes, the GLSurfaceView ends up overlaying the top half of the toolbar, with the toolbar overlaying the bottom half of the GLSurfaceView. It looks like the part of the toolbar showing at the bottom is exactly the size of the Android status bar.

Of course, I would like the toolbar to completely show and overlay the GLSurfaceView, which is what happens when the app is started all the way from `onCreate`.

Anybody has an idea about what causes this problem and how to fix it?

I found one workaround, but it is far from optimal.
I can get the toolbar to show correctly by posting `invalidate()` to the toolbar some time after `onResume()` is called. But if the `invalidate()` is called too quickly, the problem does not get fixed.
Here is the code for the workaround where `invalidate()` is called 5 seconds after `onResume()`, causing the toolbar to show correctly 5 seconds after the app restarts.

    @Override
    protected void onResume() {
        super.onResume();    
		
        mGLSurfaceView.onResume();
        
        // Test to try to fix half hidden toolbar problem
		View toolBar = findViewById(R.id.menu_bar);
		toolBar.postDelayed(new Runnable() {
			@Override
			public void run() {
				View toolBar = findViewById(R.id.menu_bar);
				toolBar.invalidate();
			}
		}, 5000);
    }