Fixed subscription of stopped FileActivities as listeners for results of operations in OperationsService

This commit is contained in:
David A. Velasco 2014-02-12 12:33:45 +01:00
parent 7b4afce57e
commit 8394350082

View file

@ -154,12 +154,19 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
if (mAccountWasSet) { if (mAccountWasSet) {
onAccountSet(mAccountWasRestored); onAccountSet(mAccountWasRestored);
} }
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
}
} }
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.removeOperationListener(this);
mOperationsServiceBinder = null;
}
} }
@ -167,10 +174,6 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
if (mOperationsServiceConnection != null) { if (mOperationsServiceConnection != null) {
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.removeOperationListener(this);
mOperationsServiceBinder = null;
}
unbindService(mOperationsServiceConnection); unbindService(mOperationsServiceConnection);
} }
} }