1 /* ownCloud Android client application
2 * Copyright (C) 2012-2014 ownCloud Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package com
.owncloud
.android
.ui
.activity
;
20 import android
.content
.Intent
;
22 import android
.os
.Bundle
;
23 import android
.view
.View
;
24 import android
.view
.View
.OnClickListener
;
25 import android
.widget
.Toast
;
29 import com
.owncloud
.android
.datamodel
.OCFile
;
30 import com
.owncloud
.android
.ui
.fragment
.FileFragment
;
33 public class UploadPathActivity
extends FolderPickerActivity
implements FileFragment
.ContainerActivity
,
34 OnClickListener
, OnEnforceableRefreshListener
{
36 public static final int RESULT_OK_SET_UPLOAD_PATH
= 1;
40 protected void onCreate(Bundle savedInstanceState
) {
41 super.onCreate(savedInstanceState
);
43 Intent intent
= getIntent();
44 String instantUploadPath
= intent
.getStringExtra("instant_upload_path");
46 OCFile folder
= new OCFile(instantUploadPath
);
48 Toast
.makeText(getApplicationContext(), instantUploadPath
, Toast
.LENGTH_LONG
).show();
50 // onBrowsedDownTo(folder);
55 public void onClick(View v
) {
56 if (v
== mCancelBtn
) {
58 } else if (v
== mChooseBtn
) {
59 Intent i
= getIntent();
60 OCFile targetFile
= (OCFile
) i
.getParcelableExtra(UploadPathActivity
.EXTRA_TARGET_FILE
);
62 Intent data
= new Intent();
63 data
.putExtra(EXTRA_CURRENT_FOLDER
, getCurrentFolder());
64 data
.putExtra(EXTRA_TARGET_FILE
, targetFile
);
65 setResult(RESULT_OK_SET_UPLOAD_PATH
, data
);