Fix: Loading icon is there when coming back to the app

This commit is contained in:
masensio 2014-05-20 12:15:26 +02:00
parent d5c6450989
commit a9bfb401d5
4 changed files with 13 additions and 3 deletions

View file

@ -388,13 +388,20 @@ public class OperationsService extends Service {
}
}
public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
public boolean dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
Pair<RemoteOperation, RemoteOperationResult> undispatched =
mUndispatchedFinishedOperations.remove(operationId);
if (undispatched != null) {
listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
return true;
//Log_OC.wtf(TAG, "Sending callback later");
} else {
if (!mPendingOperations.isEmpty()) {
nextOperation();
return true;
} else {
return false;
}
//Log_OC.wtf(TAG, "Not finished yet");
}
}

View file

@ -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();
}
}
}

View file

@ -711,6 +711,7 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener
mDownloadFinishReceiver = null;
}
Log_OC.d(TAG, "onPause() end");
super.onPause();
}

View file

@ -42,7 +42,6 @@ import android.widget.TextView;
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileOperationsHelper;
import com.owncloud.android.ui.activity.ComponentsGetter;
import com.owncloud.android.ui.activity.CopyToClipboardActivity;
import com.owncloud.android.ui.activity.FileActivity;