Code example for GLSurfaceView

Methods: onPause

0
    @Override 
    protected void onPause() { 
        // Ideally a game should implement onResume() and onPause() 
        // to take appropriate action when the activity looses focus 
        super.onPause(); 
        mGLSurfaceView.onPause();
        mSensorManager.unregisterListener(this);
    } 
 
    public void onDrawFrame(GL10 gl) {
        /* 
         * Usually, the first thing one might want to do is to clear 
         * the screen. The most efficient way of doing this is to use 
         * glClear(). 
         */ 
 
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
 
        /* 
         * Now we're ready to draw some 3D objects 
         */