@Override
    public void requestClose(boolean esc) {
        /*skip if it's not enabled or the input is null*/
        if (legacyApplication == null || (!isExitOnEscPressed())) {
            return;
        }
        if (isShowEscExitPrompt()) {
            final AlertDialog alertDialog = new AlertDialog.Builder(getContext()).create();
            alertDialog.setTitle("Exit Prompt");
            alertDialog.setMessage("Are you sure you want to quit ?");
            alertDialog.setCancelable(false);
            alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "No", (dialogInterface, i) -> alertDialog.dismiss());
            alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Yes", (dialogInterface, i) -> legacyApplication.requestClose(esc));
            alertDialog.show();
        } else {
            legacyApplication.requestClose(esc);
        }
    }
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