views:

564

answers:

1

I have an application that uses OpenGL on a GLSurfaceView. The problem is that the initial load takes quite a while processing textures and getting things ready.

What i want to do is have a simple PNG displayed (with a slight animation) while the GLSurfaceView is getting ready. As soon as it's ready to render, i would like to tear down the splash screen.

What is the right way to do this? I've tried ViewFlipper, ViewSwitcher and a bunch of other things to switch between my R.layout.main view and my GLSurfaceView but i can't seem to get it right.

Any ideas?

+4  A: 

Step #1: Make your GLSurfaceView be android:visibility="invisible" in your layout XML

Step #2: Put that GLSurfaceView inside of a FrameLayout

Step #3: Add an ImageView as another child of the same FrameLayout

Step #4: When the GLSurfaceView is ready, make the ImageView be invisible and make the GLSurfaceView be visible

CommonsWare
I've tried doing this but I must be doing something wrong because every time I add the GLSurfaceView to the main.xml, it crashes when trying to run my activity. Do you have a sample or a reference link you can point me to?
cjserio
Actually, i was able to get this to work but the problem is that the Renderer does not wake up and create it's surface if the view is invisible...
cjserio