@Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        if (CacheMenuHandler.onMenuItemSelected(item, this, cache, this::notifyDataSetChanged, false)) {
            return true;
        }

        final int menuItem = item.getItemId();
        if (menuItem == R.id.menu_delete_userdefined_waypoints) {
            dropUserdefinedWaypoints();
        } else if (menuItem == R.id.menu_delete_generated_waypoints) {
            dropGeneratedWaypoints();
        } else if (menuItem == R.id.menu_refresh) {
            refreshCache();
        } else if (menuItem == R.id.menu_gcvote) {
            showVoteDialog();
        } else if (menuItem == R.id.menu_challenge_checker) {
            ShareUtils.openUrl(this, "https://project-gc.com/Challenges/" + cache.getGeocode());
        } else if (menuItem == R.id.menu_ignore) {
            ignoreCache();
        } else if (menuItem == R.id.menu_set_coordinates) {
            setCoordinates(this);
        } else if (menuItem == R.id.menu_extract_waypoints) {
            final String searchText = cache.getShortDescription() + ' ' + cache.getDescription();
            extractWaypoints(searchText, cache);
        } else if (menuItem == R.id.menu_scan_calculated_waypoints) {
            scanForCalculatedWaypoints(cache);
        } else if (menuItem == R.id.menu_toggleWaypointsFromNote) {
            cache.setPreventWaypointsFromNote(!cache.isPreventWaypointsFromNote());
            setMenuPreventWaypointsFromNote(cache.isPreventWaypointsFromNote());
            AndroidRxUtils.andThenOnUi(AndroidRxUtils.computationScheduler, this::saveAndNotify, this::notifyDataSetChanged);
        } else if (menuItem == R.id.menu_clear_goto_history) {
            SimpleDialog.of(this).setTitle(R.string.clear_goto_history_title).setMessage(R.string.clear_goto_history).confirm(() -> AndroidRxUtils.andThenOnUi(Schedulers.io(), DataStore::clearGotoHistory, () -> {
                cache = DataStore.loadCache(InternalConnector.GEOCODE_HISTORY_CACHE, LoadFlags.LOAD_ALL_DB_ONLY);
                notifyDataSetChanged();
            }));
        } else if (menuItem == R.id.menu_add_to_route) {
            AndroidRxUtils.andThenOnUi(Schedulers.io(), () -> DataStore.appendToIndividualRoute(cache.getWaypoints()), () -> ActivityMixin.showShortToast(this, R.string.waypoints_appended_to_route));
        } else if (menuItem == R.id.menu_export_gpx) {
            new GpxExport().export(Collections.singletonList(cache), this, cache.getName());
        } else if (menuItem == R.id.menu_export_fieldnotes) {
            new FieldNoteExport().export(Collections.singletonList(cache), this);
        } else if (menuItem == R.id.menu_export_persnotes) {
            new PersonalNoteExport().export(Collections.singletonList(cache), this);
        } else if (menuItem == R.id.menu_edit_fieldnote) {
            editPersonalNote(cache, this);
        } else if (menuItem == R.id.menu_navigate) {
            NavigationAppFactory.onMenuItemSelected(item, this, cache);
        } else if (menuItem == R.id.menu_tts_toggle) {
            SpeechService.toggleService(this, cache.getCoords());
            ToggleItemType.TOGGLE_SPEECH.toggleMenuItem(item, SpeechService.isRunning());
        } else if (menuItem == R.id.menu_set_cache_icon) {
            EmojiUtils.selectEmojiPopup(this, cache.getAssignedEmoji(), cache, this::setCacheIcon);
        } else if (menuItem == R.id.menu_change_description_style) {
            changeDescriptionStyle();
        } else if (LoggingUI.onMenuItemSelected(item, this, cache, null)) {
            setNeedsRefresh();
        } else {
            return super.onOptionsItemSelected(item);
        }
        return true;
    }
waypoint selected in context menu. This variable will be gone when the waypoint context menu is a fragment.
main/src/main/java/cgeo/geocaching/CacheDetailActivity.java