Code example for GLSurfaceView

Methods: onPause

0
    protected void onPause() { 
        // Ideally a game should implement onResume() and onPause() 
        // to take appropriate action when the activity looses focus 
        super.onPause(); 
        mRenderer.stop();
        mGLSurfaceView.onPause();
    } 
 
 
    class MyRenderer implements GLSurfaceView.Renderer, SensorEventListener {
        private Cube mCube;
        private Sensor mRotationVectorSensor;
        private final float[] mRotationMatrix = new float[16];
 
        public MyRenderer() { 
            // find the rotation-vector sensor 
            mRotationVectorSensor = mSensorManager.getDefaultSensor(
                    Sensor.TYPE_ROTATION_VECTOR);
 
            mCube = new Cube();
Experience pair programming with AI  Get Codota for Java