diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index b344304e6a..3c97df19c7 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -2092,7 +2092,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven String fragmentName = pref.getFragment(); Fragment fragment = Fragment.instantiate(this, fragmentName); if (caller instanceof BaseSettingsFragment) { - fragment.setArguments(((BaseSettingsFragment) caller).buildArguments()); + fragment.setArguments(((BaseSettingsFragment) caller).buildArguments(pref.getKey())); } getSupportFragmentManager().beginTransaction() .replace(R.id.fragmentContainer, fragment, fragment.getClass().getName()) diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java index 4317ebefe4..75c29cb377 100644 --- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java @@ -319,8 +319,12 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl } public Bundle buildArguments() { + return buildArguments(appMode.getStringKey()); + } + + public Bundle buildArguments(String key) { Bundle args = new Bundle(); - args.putString(APP_MODE_KEY, appMode.getStringKey()); + args.putString(APP_MODE_KEY, key); return args; } diff --git a/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java index 001be21ebe..23fca293e3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java @@ -115,6 +115,7 @@ public class MainSettingsFragment extends BaseSettingsFragment { pref.setSummary(getAppModeDescription(getContext(), applicationMode)); pref.setChecked(isAppProfileEnabled); pref.setLayoutResource(R.layout.preference_with_descr_dialog_and_switch); + pref.setFragment(ConfigureProfileFragment.class.getName()); preferenceCategory.addPreference(pref); } }