title: Drawing Android UI on top of GLSurfaceView
body: <p>For my game, I am thinking of drawing UI elements (TextView for displaying time elapsed, Buttons for pausing/restarting game) on top of my <code>GLSurfaceView</code> using RelativeLayout...</p>
  
  <p>Till now, I was drawing all the UI elements myself directly to surfaceView but considering the wide options available from Android UI (like changing typeface of font and color), I have decided to use it.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li>Is it good practice to draw UI elements on top of <code>GLSurfaceView</code> or is it better to draw all the UI stuff myself directly to <code>GLSurfaceView</code>?</li>
  <li>I will be updating the content of the UI elements (Say <code>TextView</code>) regularly (for each 16 ms) by using <code>runOnUiThread()</code> method... Is this bad?</li>
  <li>Will my game be susceptible for Force Closes? </li>
  </ul>
  
  <p>Here is the test java code which i am using to set up the RelativeLayout... <code>glView</code> is the <code>GLSurfaceView</code> instance.</p>
  
  <pre><code>    rl = new RelativeLayout(this);
      rl.addView(glView);        
      tv = new TextView(this);
      RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
      lp.addRule(RelativeLayout.ALIGN_TOP);
      tv.setLayoutParams(lp);
      tv.setText("FPS: 0");
      tv.setBackgroundColor(0x4060ff70);
      rl.addView(tv);
  
      setContentView(rl);
  </code></pre>