title: GLSurfaceView lifecycle methods onPause() and onResume()
body: <p>I'm trying to correctly play with OpenGL in my application and having a few problems when it comes to using the Lifecycle Methods: <code>onPause()</code> and <code>onResume()</code>.</p>
  <p>The <a href="http://developer.android.com/reference/android/opengl/GLSurfaceView.html" rel="nofollow noreferrer">documentation</a> states:</p>
  <blockquote>
  <p>Activity Life-cycle</p>
  <p>A GLSurfaceView must be notified when the activity is paused and resumed. GLSurfaceView clients are required to call onPause() when the activity pauses and onResume() when the activity resumes. These calls allow GLSurfaceView to pause and resume the rendering thread, and also allow GLSurfaceView to release and recreate the OpenGL display.</p>
  </blockquote>
  <p>First of all I was slightly confused as <code>onPause()</code> and <code>onResume()</code> are, throughout the rest of Android, Lifecycle events as called by the System (Activity/Fragments). Here, from the description (including the detailed descriptions in <a href="http://developer.android.com/reference/android/opengl/GLSurfaceView.html#onPause()" rel="nofollow noreferrer">onPause()</a> and in <a href="http://developer.android.com/reference/android/opengl/GLSurfaceView.html#onResume()" rel="nofollow noreferrer">onResume()</a>) it seems that they have to be called manually by the developer.</p>
  <p>I've been using <code>GLSurfaceView</code> <strong>without</strong> calling <code>onPause()</code> and <code>onResume()</code> and haven't noticed a problem. However, in the interests of playing ball (and decreasing likely suspects for strange behaviour on resuming the Activity) I'm trying to add them in as described in the documentation.</p>
  <p>It seems however that using onResume() causes a <code>NullPointerException</code> to be thrown:</p>
  <pre><code>07-23 13:20:08.570: E/AndroidRuntime(20777): Caused by: java.lang.NullPointerException
  07-23 13:20:08.570: E/AndroidRuntime(20777):    at android.opengl.GLSurfaceView.onResume(GLSurfaceView.java:544)
  07-23 13:20:08.570: E/AndroidRuntime(20777):    at com.ActivityNameHere.onResume(ActivityNameHere.java:151)
  </code></pre>
  <p>Is there a step I'm missing to register the <code>Activity</code> with the <code>View</code>?</p>