Fixed subscription of stopped FileActivities as listeners for results of operations...
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 12 Feb 2014 11:33:45 +0000 (12:33 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 12 Feb 2014 11:33:45 +0000 (12:33 +0100)
src/com/owncloud/android/ui/activity/FileActivity.java

index 28f7875..bcedf60 100644 (file)
@@ -154,12 +154,19 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
         if (mAccountWasSet) {
             onAccountSet(mAccountWasRestored);
         }
         if (mAccountWasSet) {
             onAccountSet(mAccountWasRestored);
         }
+        if (mOperationsServiceBinder != null) {
+            mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+        }
     }
     
     
     @Override 
     protected void onStop() {
         super.onStop();
     }
     
     
     @Override 
     protected void 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() {
         super.onDestroy();
         if (mOperationsServiceConnection != null) {
     protected void onDestroy() {
         super.onDestroy();
         if (mOperationsServiceConnection != null) {
-            if (mOperationsServiceBinder != null) {
-                mOperationsServiceBinder.removeOperationListener(this);
-                mOperationsServiceBinder = null;
-            }
             unbindService(mOperationsServiceConnection);
         }
     }
             unbindService(mOperationsServiceConnection);
         }
     }