+ Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+ Toast.LENGTH_LONG);
+ t.show();
+ }
+ }
+
+
+ private void updateFileFromDB(){
+ OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath());
+ if (file != null) {
+ setFile(file);
+ }
+ }
+
+ /**
+ * Show loading dialog
+ */
+ public void showLoadingDialog() {
+ // Construct dialog
+ LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
+ FragmentManager fm = getSupportFragmentManager();
+ FragmentTransaction ft = fm.beginTransaction();
+ loading.show(ft, DIALOG_WAIT_TAG);
+
+ }
+
+
+ /**
+ * Dismiss loading dialog
+ */
+ public void dismissLoadingDialog(){
+ Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
+ if (frag != null) {
+ LoadingDialog loading = (LoadingDialog) frag;
+ loading.dismiss();
+ }
+ }
+
+
+ private void doOnResumeAndBound() {
+ mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+ long waitingForOpId = mFileOperationsHelper.getOpIdWaitingFor();
+ if (waitingForOpId <= Integer.MAX_VALUE) {
+ boolean wait = mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId, this);
+ if (!wait ) {
+ dismissLoadingDialog();
+ }