private void doSearch(final String baseKey, final ArrayList<PrefSearchDescriptor> data, final PreferenceGroup start) {
        lazyInitPreferenceKeys();
        final int prefCount = start.getPreferenceCount();
        for (int i = 0; i < prefCount; i++) {
            final Preference pref = start.getPreference(i);
            // we can only address prefs that have a key, so create a generic one
            if (StringUtils.isBlank(pref.getKey())) {
                synchronized (this) {
                    pref.setKey(baseKey + "-" + (nextKey++));
                }
            }
            data.add(new PrefSearchDescriptor(baseKey, pref.getKey(), pref.getTitle(), pref.getSummary(), icon, ArrayUtils.contains(basicPreferences, pref.getKey()) || pref instanceof PreferenceTextAlwaysShow));
            if (pref instanceof PreferenceGroup) {
                doSearch(baseKey, data, (PreferenceGroup) pref);
            }
        }
    }
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