From 4aad8c13102941d6961492491d6fc6480eae58dc Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 18 Jul 2016 21:44:14 +0200 Subject: [PATCH] use class name of fragment for saving preferences --- .../plugins/ConfigBuilder/ConfigBuilderFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index 685f19e72a..c2e2ac11c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -778,8 +778,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI for (int type = 1; type < PluginBase.LAST; type++) { for (PluginBase p : pluginList) { - String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled"; - String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible"; + String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled"; + String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible"; editor.putBoolean(settingEnabled, p.isEnabled(type)); editor.putBoolean(settingVisible, p.isVisibleInTabs(type)); } @@ -795,8 +795,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); for (int type = 1; type < PluginBase.LAST; type++) { for (PluginBase p : pluginList) { - String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled"; - String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible"; + String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled"; + String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible"; if (SP.contains(settingEnabled)) p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true)); if (SP.contains(settingVisible))