private void updateRoutingProfilePref(@StringRes final int prefId, final RoutingMode mode, final ArrayList<String> profiles, final int number) {
        final String current = StringUtils.defaultIfBlank(Settings.getRoutingProfile(mode), getString(R.string.routingmode_none));
        final ListPreference pref = findPreference(getString(prefId));
        assert pref != null;

        final ArrayList<String> prefProfiles = new ArrayList<>(profiles);
        if (number > 0) {
            prefProfiles.add(getString(R.string.routingmode_none));

            final String title = String.format(getString(R.string.init_brouterProfileUserNumber), number);
            pref.setDialogTitle(title);
            pref.setTitle(title);
        }

        final CharSequence[] entries = prefProfiles.toArray(new CharSequence[0]);
        final CharSequence[] values = prefProfiles.toArray(new CharSequence[0]);

        pref.setEntries(entries);
        pref.setEntryValues(values);
        pref.setSummary(current);
        pref.setOnPreferenceChangeListener((preference, newValue) -> {
            preference.setSummary(newValue.toString());
            return true;
        });

        for (int i = 0; i < entries.length; i++) {
            if (current.contentEquals(entries[i])) {
                pref.setValueIndex(i);
                break;
            }
        }
    }
Fill the choice list for default navigation tools.
main/src/main/java/cgeo/geocaching/settings/fragments/PreferenceNavigationFragment.java