Handle exceptions in StatusLinePlugin
This commit is contained in:
parent
cd16b71759
commit
77181f6f7f
1 changed files with 6 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue