Use the new strings for upload and download fails when it is necessary
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileActivity.java
index bebc143..f9d8bb1 100644 (file)
@@ -180,9 +180,6 @@ implements OnRemoteOperationListener, ComponentsGetter {
         if (mAccountWasSet) {
             onAccountSet(mAccountWasRestored);
         }
-        if (mOperationsServiceBinder != null) {
-            mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
-        }
     }
     
     @Override
@@ -204,20 +201,9 @@ implements OnRemoteOperationListener, ComponentsGetter {
         super.onPause();
     }
     
-    @Override 
-    protected void onStop() {
-
-        if (mOperationsServiceBinder != null) {
-            mOperationsServiceBinder.removeOperationListener(this);
-        }
-        
-        super.onStop();
-    }
-    
     
     @Override
     protected void onDestroy() {
-        super.onDestroy();
         if (mOperationsServiceConnection != null) {
             unbindService(mOperationsServiceConnection);
             mOperationsServiceBinder = null;
@@ -230,6 +216,7 @@ implements OnRemoteOperationListener, ComponentsGetter {
             unbindService(mUploadServiceConnection);
             mUploadServiceConnection = null;
         }
+        super.onDestroy();
     }
     
     
@@ -553,7 +540,10 @@ implements OnRemoteOperationListener, ComponentsGetter {
         mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
         long waitingForOpId = mFileOperationsHelper.getOpIdWaitingFor();
         if (waitingForOpId <= Integer.MAX_VALUE) {
-            mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId, this);
+            boolean wait = mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId, this);
+            if (!wait ) {
+                dismissLoadingDialog();
+            }
         }
     }