After making several attempts and changing the order of commands and views, I got the transparent background of mGLView. Using parent FrameLayout (fl) and two childs: a second FrameLayout (mbView) and (mGLView) in that order. Important to force mGLView.setZOrderOnTop (true) and not to forget to clear the frambuffer to an alpha RGBColor color (0, 0, 0, 0). This is an example:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (master != null) {
copy(master);
}
myWidth =1280;
myHeight =800;
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
boolean isPortrait = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRIT;
int frameBufferWidth = isPortrait ? myHeight : myWidth;
int frameBufferHeight = isPortrait ? myWidth : myHeight;
Bitmap frameBuffer = Bitmap.createBitmap(frameBufferWidth, frameBufferHeight, Config.RGB_565); // for mbView
scaleX = (float) frameBufferWidth / getWindowManager().getDefaultDisplay().getWidth();
scaleY = (float) frameBufferHeight / getWindowManager().getDefaultDisplay().getHeight();
FrameLayout fl = new FrameLayout(this);
FrameLayout.LayoutParams flp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
mbView = new FrameLayout(this);
fl.addView(mbView);
mGLView = new GLSurfaceView(this);
mGLView.setZOrderOnTop(true);
mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT); renderer = new RendererCarpa();
mGLView.setRenderer(renderer);
fl.addView(mGLView);
this.setContentView(fl, flp);}
.............
@Override
public void onDrawFrame(GL10 arg0) {
// TODO Auto-generated method stub
if (touchTurn != 0) {
carpa.rotateY(touchTurn);
touchTurn = 0;
}
if (touchTurnUp != 0) {
carpa.rotateX(touchTurnUp);
touchTurnUp = 0;
}
// 2D Redraw
// 3D Redraw
fb.clear(transp); // where transp = RGBColor transp = new RGBColor(0, 0, 0, 0)
world.renderScene(fb);
world.draw(fb);
fb.display();
}