private void saveAndFinishDialog() {
        ActivityMixin.showToast(this.getActivity(), R.string.warn_calculator_state_save);

        final Activity activity = requireActivity();
        if (activity instanceof CoordinatesInputDialog.CoordinateUpdate) {
            ((CoordinatesInputDialog.CoordinateUpdate) activity).updateCoordinates(createFromDialog());
        }

        //save changes to the var list
        if (varList instanceof CacheVariableList) {
            ((CacheVariableList) varList).saveState();
        }
        dismiss();
    }
Dialog to manage calculation of a coordinate
main/src/main/java/cgeo/geocaching/ui/dialog/CoordinatesCalculateGlobalDialog.java