private void openRequestedFragment(final String preference) {
        final Intent intent = getIntent();
        final int fragmentId = intent.getIntExtra(INTENT_OPEN_SCREEN, -1);
        String fragment = "";
        // try to get fragment key from preference name (if necessary)
        if (fragmentId < 0 && StringUtils.isNotBlank(preference)) {
            synchronized (searchIndex) {
                for (BasePreferenceFragment.PrefSearchDescriptor pref : searchIndex) {
                    if (StringUtils.equals(preference, pref.prefKey)) {
                        fragment = pref.baseKey;
                        break;
                    }
                }
                if (StringUtils.isBlank(fragment)) {
                    delayedOpenPreference = preference;
                    return;
                }
            }
        } else {
            try {
                fragment = getString(fragmentId);
            } catch (Exception ignore) {
                fragment = "";
            }

        }
        openRequestedFragment(fragment, preference);
    }
This method sets the fragment which is used upon opening the settings. This may be the user directly or a
requesting Intent.
main/src/main/java/cgeo/geocaching/settings/SettingsActivity.java