private void openRequestedFragment(@NonNull final String baseKey, @Nullable final String scrollToPrefKey) {
        if (isInDualPaneMode() && StringUtils.isBlank(baseKey)) {
            // never open category view in content pane when in dual pane mode
            return;
        }
        Fragment preferenceFragment = new PreferencesFragmentRoot();

        // main configuration screens
        if (StringUtils.equals(baseKey, getString(R.string.preference_screen_services))) {
            preferenceFragment = new PreferenceServicesFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_appearance))) {
            preferenceFragment = new PreferenceAppearanceFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_cachedetails))) {
            preferenceFragment = new PreferenceCachedetailsFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_map_sources))) {
            preferenceFragment = new PreferenceMapSourcesFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_map_content_behavior))) {
            preferenceFragment = new PreferenceMapContentBehaviorFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_logging))) {
            preferenceFragment = new PreferenceLoggingFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_offlinedata))) {
            preferenceFragment = new PreferenceOfflinedataFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_navigation))) {
            preferenceFragment = new PreferenceNavigationFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_system))) {
            preferenceFragment = new PreferenceSystemFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_backup))) {
            preferenceFragment = new PreferenceBackupFragment();

        // service configuration screens
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_sendtocgeo))) {
            preferenceFragment = new PreferenceServiceSendToCgeoFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_geokrety))) {
            preferenceFragment = new PreferenceServiceGeokretyOrgFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_gc))) {
            preferenceFragment = new PreferenceServiceGeocachingComFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocde))) {
            preferenceFragment = new PreferenceServiceOpencachingDeFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocuk))) {
            preferenceFragment = new PreferenceServiceOpencacheUkFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocnl))) {
            preferenceFragment = new PreferenceServiceOpencachingNlFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocpl))) {
            preferenceFragment = new PreferenceServiceOpencachingPlFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocus))) {
            preferenceFragment = new PreferenceServiceOpencachingUsFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ocro))) {
            preferenceFragment = new PreferenceServiceOpencachingRoFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_al))) {
            preferenceFragment = new PreferenceServiceGeocachingComAdventureLabsFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_ec))) {
            preferenceFragment = new PreferenceServiceExtremcachingComFragment();
        } else if (StringUtils.equals(baseKey, getString(R.string.preference_screen_su))) {
            preferenceFragment = new PreferenceServiceGeocachingSuFragment();
        }

        if (StringUtils.isNotBlank(scrollToPrefKey)) {
            ((BasePreferenceFragment) preferenceFragment).setScrollToPrefCallback(this::scrollToCallback, baseKey, scrollToPrefKey);
        }
        getSupportFragmentManager()
                .beginTransaction()
                .replace(preferenceContentView, preferenceFragment)
                .commit();
    }
This method sets the fragment given by its base key,
and optionally starts scrolling to a preference identified by its key
main/src/main/java/cgeo/geocaching/settings/SettingsActivity.java