@Override
    public void loseFocus() {
        /*skip the block if the invoking instances are nullptr*/
        if (legacyApplication == null || glSurfaceView == null) {
            return;
        }
        glSurfaceView.onPause();
        /*pause the audio*/
        legacyApplication.loseFocus();
        final AudioRenderer audioRenderer = legacyApplication.getAudioRenderer();
        if (audioRenderer != null) {
            audioRenderer.pauseAll();
        }
        /*pause the sensors (aka joysticks)*/
        if (legacyApplication.getContext() != null) {
            final JoyInput joyInput = legacyApplication.getContext().getJoyInput();
            if (joyInput != null) {
                if (joyInput instanceof AndroidSensorJoyInput) {
                    final AndroidSensorJoyInput androidJoyInput = (AndroidSensorJoyInput) joyInput;
                    androidJoyInput.pauseSensors();
                }
            }
        }
        setGLThreadPaused(true);
        jmeSurfaceViewLogger.log(Level.INFO, "Game goes idle");
    }
A state change observer to the holder Activity life cycle, used to keep this android view up-to-date with the holder activity life cycle.

@param source the life cycle source, aka the observable object.
@param event  the fired event by the observable object, which is dispatched and sent to the observers.
jme3-android/src/main/java/com/jme3/view/surfaceview/JmeSurfaceView.java