code: private void checkAppExit(Object sender) {
          NavLocation curLocation = navigationManager.getModel().getCurrentLocation();
          if (curLocation == null) {
              navigationManager.postEvent2C(new NavigationManager.Event.OnAppExit(sender));
          }
      }
docs: Check the app is exiting
  
  @param sender The sender