Android GLSurfaceView with drawable background

Jlam picture Jlam · Oct 2, 2010 · Viewed 10.1k times · Source

I have a GLSurfaceView with a drawable as background, however only the background is visible when rendered without surfaceView.setZOrderOnTop(true)

I need to avoid using setZOrderOnTop(true) because there are static TextView's being used on top of the GLSurfaceView.

Any suggestions for getting this to work?

Answer

Romain Guy picture Romain Guy · Oct 2, 2010

GLSurfaceView cannot really have a background. The way a surface view works is by cutting a hole through your Activity's window and showing another surface behind. Setting setZOrderOnTop(true) moves the surface above the Activity's window.