Pausing and Resuming

These are common methods independent of the details of our rendering.

28     @Override
29     protected void onResume()
30     {
31         // The activity must call the GL surface view's onResume() on activity onResume().
32         super.onResume();
33         GLView.onResume();
34     }
35 
36     @Override
37     protected void onPause()
38     {
39         // The activity must call the GL surface view's onPause() on activity onPause().
40         super.onPause();
41         GLView.onPause();
42     }

Notes

onPause is invoked when another activity comes to the foreground, and onResume is invoked when our activity returns to the foreground. Forwarding these to the GLView stops and restarts the the rendering thread when the activity is not in the foreground.