@Override
protected void onStop() {
super.onStop();
- if (mOperationsServiceBinder != null) {
- mOperationsServiceBinder.removeOperationListener(this);
- mOperationsServiceBinder = null;
- }
}
@Override
protected void onDestroy() {
super.onDestroy();
- if (mOperationsServiceConnection != null)
+ if (mOperationsServiceConnection != null) {
+ if (mOperationsServiceBinder != null) {
+ mOperationsServiceBinder.removeOperationListener(this);
+ mOperationsServiceBinder = null;
+ }
unbindService(mOperationsServiceConnection);
+ }
}