I’m very new to an Android platform and currently trying figure out why things work this way:
If I create GLSurfaceView and add it using the setContentView or addContentView to an activity everything works fine (Renderer.onDrawFrame is called as expected). However if I add my GLSurfaceView to another ViewGroup (which is then added using setContentView) nothing is rendered.
So what is the difference between addView and addContentView ?
In the end I need to create a custom view with OpenGL rendering in background and some controls on top.
Also what is the point of separating View and ViewGroup? Why not to join them (like it is done in CocoaTouch) ?
setContentView(View)sets the parentViewfor an Activity (or dialog etc…).addView(View)adds aViewto aViewGroup.ViewandViewGroupare mostly different.Viewis a more specific single entity. It should be used more on one facet of what you are trying to do.ViewGroup, however, focuses more on the whole and acts (is) a container and layout organizer for a collection ofViews.Can you post all the code related to the GLSurfaceView and how you are setting it as contentView?