Version server is checked every time the root folder is refreshed, and both version...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileActivity.java
index 28f7875..dc3ad0d 100644 (file)
@@ -154,12 +154,18 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
         if (mAccountWasSet) {
             onAccountSet(mAccountWasRestored);
         }
+        if (mOperationsServiceBinder != null) {
+            mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+        }
     }
     
     
     @Override 
     protected void onStop() {
         super.onStop();
+        if (mOperationsServiceBinder != null) {
+            mOperationsServiceBinder.removeOperationListener(this);
+        }
     }
     
     
@@ -167,11 +173,8 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
     protected void onDestroy() {
         super.onDestroy();
         if (mOperationsServiceConnection != null) {
-            if (mOperationsServiceBinder != null) {
-                mOperationsServiceBinder.removeOperationListener(this);
-                mOperationsServiceBinder = null;
-            }
             unbindService(mOperationsServiceConnection);
+            mOperationsServiceBinder = null;
         }
     }