title: Adding views on a custom GLSurfaceView
body: <p>(note that I'm a total beginner in android programming)</p>
  
  <p>I have a class that derives from GLSurfaceView.</p>
  
  <p>What I would like is to place some views (image,text) on top of it. 
  I managed to get the text view to position properly by using <code>textView.setPadding(300,0,0,0)</code>;</p>
  
  <p>The problem is that I cannot get the image view to position properly. I've tried <code>imageView.layout(), imageView.setPadding()</code>.</p>
  
  <p>Here is the code:</p>
  
  <pre><code> ImageView imageView=new .... // Create and set drawable
  
   // Setting size works as expected
   RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(200,200);
   imageView.setLayoutParams(lp);
  
   surfaceView = new MySurfaceViewDerivedFromOpenGLSurface(...);
  
   setContentView(surfaceView);
  
   addContentView(textView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
   addContentView(textView2, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
   addContentView(imageView, lp); // Add the image view
  </code></pre>
  
  <p>Is it even possible to position it properly this way without specifing the stuff in the XML file? </p>
  
  <p>I saw an example in the sdk dev website that shows how to create views on the openGL surface view, but the problem is that I have a derived class and I don't know if I can specify it in the XML file (I have 0% experience in the XML, Eclipse handled everything for me so far).</p>