Merge pull request #1088 from owncloud/updated_docs_about_target_of_PRs
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / UploadPathActivity.java
index 06f71c6..db704d1 100644 (file)
@@ -1,5 +1,7 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ *   ownCloud Android client application
+ *
+ *   Copyright (C) 2015 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2,
 package com.owncloud.android.ui.activity;
 
 import android.accounts.Account;
-import android.content.Intent;
-
 import android.os.Bundle;
-import android.view.View;
 import android.view.View.OnClickListener;
 
 import com.owncloud.android.datamodel.OCFile;
@@ -33,7 +32,6 @@ public class UploadPathActivity extends FolderPickerActivity implements FileFrag
 
     public static final String KEY_INSTANT_UPLOAD_PATH = "INSTANT_UPLOAD_PATH";
 
-    public static final int RESULT_OK_SET_UPLOAD_PATH = 1;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -41,6 +39,7 @@ public class UploadPathActivity extends FolderPickerActivity implements FileFrag
 
         String instantUploadPath = getIntent().getStringExtra(KEY_INSTANT_UPLOAD_PATH);
 
+        // The caller activity (Preferences) is not a FileActivity, so it has no OCFile, only a path.
         OCFile folder = new OCFile(instantUploadPath);
 
         setFile(folder);
@@ -68,7 +67,8 @@ public class UploadPathActivity extends FolderPickerActivity implements FileFrag
 
             if (!stateWasRecovered) {
                 OCFileListFragment listOfFolders = getListOfFilesFragment();
-                listOfFolders.listDirectory(folder);
+                // TODO Enable when "On Device" is recovered ?
+                listOfFolders.listDirectory(folder/*, false*/);
 
                 startSyncFolderOperation(folder, false);
             }
@@ -76,16 +76,4 @@ public class UploadPathActivity extends FolderPickerActivity implements FileFrag
             updateNavigationElementsInActionBar();
         }
     }
-
-    @Override
-    public void onClick(View v) {
-        if (v == mCancelBtn) {
-            finish();
-        } else if (v == mChooseBtn) {
-            Intent data = new Intent();
-            data.putExtra(EXTRA_CURRENT_FOLDER, getCurrentFolder());
-            setResult(RESULT_OK_SET_UPLOAD_PATH, data);
-            finish();
-        }
-    }
 }