protected void scanForCalculatedWaypoints(@Nullable final Geocache cache) {
        if (cache != null) {
            final List<String> toScan = new ArrayList<>();
            final List<Pair<String, String>> existingCoords = new ArrayList<>();
            toScan.add(TextUtils.stripHtml(cache.getDescription()));
            toScan.add(cache.getHint());
            for (Waypoint w : cache.getWaypoints()) {
                toScan.add(w.getNote());
                if (w.isCalculated()) {
                    final CalculatedCoordinate cc = CalculatedCoordinate.createFromConfig(w.getCalcStateConfig());
                    existingCoords.add(new Pair<>(cc.getLatitudePattern(), cc.getLongitudePattern()));
                }
            }
            final List<Pair<String, String>> patterns = FormulaUtils.scanForCoordinates(toScan, existingCoords);
            if (patterns.isEmpty()) {
                ActivityMixin.showShortToast(this, R.string.variables_scanlisting_nopatternfound);
            } else {
                final SimpleDialog.ItemSelectModel<Pair<String, String>> model = new SimpleDialog.ItemSelectModel<>();
                model.setItems(patterns).setDisplayMapper((s) -> TextParam.text("`" + s.first + " | " + s.second + "`").setMarkdown(true));

                SimpleDialog.of(this).setTitle(TextParam.id(R.string.variables_scanlisting_choosepattern_title))
                        .selectMultiple(model, set -> {
                            final int added = cache.addCalculatedWaypoints(set, LocalizationUtils.getString(R.string.calccoord_generate_waypointnameprefix));
                            if (added > 0) {
                                GeocacheChangedBroadcastReceiver.sendBroadcast(this, cache.getGeocode());
                            }
                        });
            }
        } else {
            showToast(res.getQuantityString(R.plurals.extract_waypoints_result, 0));
        }
    }
Common actions for all onCreate functions.
main/src/main/java/cgeo/geocaching/activity/AbstractActivity.java