try catch on load settings

This commit is contained in:
Milos Kozak 2016-09-08 13:15:07 +02:00
parent ae9b03f1ae
commit 2c10ade944

View file

@ -150,12 +150,16 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
for (int type = 1; type < PluginBase.LAST; type++) { for (int type = 1; type < PluginBase.LAST; type++) {
for (PluginBase p : pluginList) { for (PluginBase p : pluginList) {
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled"; try {
String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible"; String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled";
if (SP.contains(settingEnabled)) String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible";
p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true)); if (SP.contains(settingEnabled))
if (SP.contains(settingVisible)) p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true));
p.setFragmentVisible(type, SP.getBoolean(settingVisible, true)); if (SP.contains(settingVisible))
p.setFragmentVisible(type, SP.getBoolean(settingVisible, true));
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
verifySelectionInCategories(); verifySelectionInCategories();