瀏覽代碼

Fixed crash when selecting a folder to move file into after rotating the device in the selection view

David A. Velasco 10 年之前
父節點
當前提交
24ffdc2c2f

+ 2 - 0
src/com/owncloud/android/ui/activity/FileActivity.java

@@ -80,6 +80,8 @@ implements OnRemoteOperationListener, ComponentsGetter {
     private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
     private static final String KEY_WAITING_FOR_OP_ID = "WAITING_FOR_OP_ID";;
     
+    protected static final long DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS = 200;
+    
     
     /** OwnCloud {@link Account} where the main {@link OCFile} handled by the activity is located. */
     private Account mAccount;

+ 14 - 1
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -21,6 +21,8 @@ package com.owncloud.android.ui.activity;
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.commons.httpclient.methods.PostMethod;
+
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.AuthenticatorException;
@@ -556,7 +558,18 @@ OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
 
         } else if (requestCode == ACTION_MOVE_FILES && (resultCode == RESULT_OK || 
                 resultCode == MoveActivity.RESULT_OK_AND_MOVE)){
-            requestMoveOperation(data, resultCode);
+
+            final Intent fData = data;
+            final int fResultCode = resultCode; 
+            getHandler().postDelayed(
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        requestMoveOperation(fData, fResultCode);
+                    }
+                }, 
+                DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS
+            );
         }
     }