private int checkExtendedSettingsVisibilityHelper(final PreferenceGroup start, final boolean forceShowAll) {
        // if key of start group is included, all entries below will be included as well
        final boolean showAll = forceShowAll || ArrayUtils.contains(basicPreferences, start.getKey());
        // recursively test all items below
        int visibleCount = 0;
        final int prefCount = start.getPreferenceCount();
        for (int i = 0; i < prefCount; i++) {
            final Preference pref = start.getPreference(i);
            if (showAll || ArrayUtils.contains(basicPreferences, pref.getKey()) || pref instanceof PreferenceTextAlwaysShow) {
                pref.setVisible(true);
                visibleCount++;
            } else if (!(pref instanceof PreferenceGroup)) {
                pref.setVisible(false);
            }
            if (pref instanceof PreferenceGroup) {
                visibleCount += checkExtendedSettingsVisibilityHelper((PreferenceGroup) pref, showAll);
            }
        }
        if (visibleCount == 0) {
            start.setVisible(false);
        }
        return visibleCount;
    }
searches recursively in all elements of given prefGroup for first occurrence of s
returns found preference on success, null else
(prefers preference entries over preference groups)
main/src/main/java/cgeo/geocaching/settings/fragments/BasePreferenceFragment.java