private void generateRangeCoordinates() {

        final List<String> varsToConsider = new ArrayList<>(varList.getDependentVariables(calcCoord.getNeededVars()));
        final Iterator<String> it = varsToConsider.iterator();
        while (it.hasNext()) {
            final VariableMap.VariableState state = varList.getState(it.next());
            if (state == null || state.getFormula() == null || state.getFormula().getRangeIndexSize() == 1) {
                it.remove();
            }
        }
        TextUtils.sortListLocaleAware(varsToConsider);
        if (varsToConsider.isEmpty()) {
            ActivityMixin.showShortToast(this.getActivity(), R.string.calccoord_generate_error_novarwithrange);
            return;
        }

        final List<Pair<String, Geopoint>> gps = new ArrayList<>();
        generateRangeCoordinatesRecursive(varsToConsider, 0, null, gps);

        if (gps.isEmpty()) {
            ActivityMixin.showShortToast(this.getActivity(), R.string.calccoord_generate_error_novalidgeopoints);
            return;
        }

        final SimpleDialog.ItemSelectModel<Pair<String, Geopoint>> model = new SimpleDialog.ItemSelectModel<>();
        model
            .setItems(gps)
            .setDisplayMapper((p) -> TextParam.text(p.first + ":\n" + p.second));

        SimpleDialog.of(this.getActivity()).setTitle(TextParam.id(R.string.calccoord_generate_title))
                .setNeutralButton(TextParam.id(R.string.calccoord_generate_showonmap))
                .setNeutralAction(() -> {
                    final Set<Pair<String, Geopoint>> s = model.getSelectedItems();
                    if (s.isEmpty()) {
                        ActivityMixin.showShortToast(this.getActivity(), R.string.calccoord_generate_error_nogeopointselected);
                        return;
                    }
                    //generate a new fake cache in-memory (without a coordinate) to enable showing the waypoints on a map
                    final String dummyGeocode = "TEMP-SHOWWPS-" + System.currentTimeMillis();
                    final Geocache dummyCache = new Geocache();
                    dummyCache.setGeocode(dummyGeocode);
                    DataStore.saveCache(dummyCache, EnumSet.of(LoadFlags.SaveFlag.CACHE));
                    generateWaypoints(dummyCache, false, s);

                    DefaultMap.startActivityGeoCode(this.getActivity(), dummyGeocode);
                })
                .selectMultiple(model, s -> {
                    if (s.isEmpty()) {
                        ActivityMixin.showShortToast(this.getActivity(), R.string.calccoord_generate_error_nogeopointselected);
                        return;
                    }
                    final Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
                    generateWaypoints(cache, true, s);
                });
    }
Save the current state of the calculator such that it can be restored after screen rotation (or similar)
main/src/main/java/cgeo/geocaching/ui/dialog/CoordinatesCalculateGlobalDialog.java