Merge pull request #500 from owncloud/refactor_update_filelist_from_database
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileActivity.java
index 11e0a39..f9d8bb1 100644 (file)
@@ -204,7 +204,6 @@ implements OnRemoteOperationListener, ComponentsGetter {
     
     @Override
     protected void onDestroy() {
-        super.onDestroy();
         if (mOperationsServiceConnection != null) {
             unbindService(mOperationsServiceConnection);
             mOperationsServiceBinder = null;
@@ -217,6 +216,7 @@ implements OnRemoteOperationListener, ComponentsGetter {
             unbindService(mUploadServiceConnection);
             mUploadServiceConnection = null;
         }
+        super.onDestroy();
     }
     
     
@@ -540,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();
+            }
         }
     }