private void generateWaypoints(final Geocache cache, final boolean updateDatabase, final Collection<Pair<String, Geopoint>> gps) {
        boolean changed = false;
        for (Pair<String, Geopoint> p : gps) {
            final Waypoint wp = new Waypoint(LocalizationUtils.getString(R.string.calccoord_generate_waypointnameprefix) + ": " + p.first, WaypointType.GENERATED, true);
            wp.setCoords(p.second);
            wp.setGeocode(cache.getGeocode());
            changed = changed | cache.addOrChangeWaypoint(wp, updateDatabase);
        }

        if (changed) {
            ActivityMixin.showShortToast(this.getActivity(), getString(R.string.waypoint_added));
        }
    }
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