Handle exceptions in StatusLinePlugin

This commit is contained in:
Milos Kozak 2017-05-09 21:32:24 +02:00
parent cd16b71759
commit 77181f6f7f

View file

@ -44,10 +44,6 @@ public class StatuslinePlugin implements PluginBase {
StatuslinePlugin(Context ctx) {
this.ctx = ctx;
this.mPrefs = PreferenceManager.getDefaultSharedPreferences(ctx);
if (fragmentEnabled) {
MainApp.bus().register(this);
}
}
@Override
@ -107,11 +103,15 @@ public class StatuslinePlugin implements PluginBase {
this.fragmentEnabled = fragmentEnabled;
if (fragmentEnabled) {
MainApp.bus().register(this);
try {
MainApp.bus().register(this);
} catch (Exception e) {}
sendStatus();
}
else{
MainApp.bus().unregister(this);
try {
MainApp.bus().unregister(this);
} catch (Exception e) {}
sendStatus();
}
}