@Override
    public void onBackPressed() {
        // @todo should be replaced by setting a OnBackPressedDispatcher
        final GeocacheFilter newFilter = getFilterFromView();
        final boolean filterWasChanged = !originalFilterConfig.equals(newFilter.toConfig());
        if (filterWasChanged) {
            SimpleDialog.of(this).setTitle(R.string.confirm_unsaved_changes_title).setMessage(R.string.confirm_discard_changes).confirm(this::finish);
        } else {
            finish();
        }
        super.onBackPressed();
    }
Show a filter selection using an {@code ExpandableListView}.
main/src/main/java/cgeo/geocaching/filters/gui/GeocacheFilterActivity.java