mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
catch exception when unregistering receivers that have not been registered before
This commit is contained in:
parent
f81e44d339
commit
e65068d226
@ -662,7 +662,11 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
try {
|
||||||
unregisterReceiver(this.mEventReceiver);
|
unregisterReceiver(this.mEventReceiver);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
//ignored
|
||||||
|
}
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +676,11 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||||
registerReceiver(this.mEventReceiver, filter);
|
registerReceiver(this.mEventReceiver, filter);
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
unregisterReceiver(this.mEventReceiver);
|
unregisterReceiver(this.mEventReceiver);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
//ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user