From b499bce2258bef0ca5f868e9b257bcfbb68ea12c Mon Sep 17 00:00:00 2001 From: tobiaskaminsky Date: Thu, 31 Aug 2017 10:12:25 +0200 Subject: [PATCH] use same String for Intent --- .../android/ui/activity/ManageAccountsActivity.java | 9 ++++----- .../owncloud/android/ui/activity/UserInfoActivity.java | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java b/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java index 5f1b673420..d8d9be6ee6 100644 --- a/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java @@ -48,9 +48,9 @@ import com.owncloud.android.datamodel.ArbitraryDataProvider; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.files.services.FileDownloader; import com.owncloud.android.files.services.FileUploader; +import com.owncloud.android.jobs.AccountRemovalJob; import com.owncloud.android.lib.common.OwnCloudAccount; import com.owncloud.android.lib.common.utils.Log_OC; -import com.owncloud.android.jobs.AccountRemovalJob; import com.owncloud.android.services.OperationsService; import com.owncloud.android.ui.adapter.AccountListAdapter; import com.owncloud.android.ui.adapter.AccountListItem; @@ -79,7 +79,6 @@ public class ManageAccountsActivity extends FileActivity public static final String PENDING_FOR_REMOVAL = "PENDING_FOR_REMOVAL"; - private static final String KEY_ACCOUNT = "ACCOUNT"; private static final String KEY_DISPLAY_NAME = "DISPLAY_NAME"; private static final int KEY_USER_INFO_REQUEST_CODE = 13; @@ -134,7 +133,7 @@ public class ManageAccountsActivity extends FileActivity if (item != null && item.isEnabled()) { Account account = item.getAccount(); - intent.putExtra(KEY_ACCOUNT, Parcels.wrap(account)); + intent.putExtra(UserInfoActivity.KEY_ACCOUNT, Parcels.wrap(account)); try { OwnCloudAccount oca = new OwnCloudAccount(account, MainApp.getAppContext()); intent.putExtra(KEY_DISPLAY_NAME, oca.getDisplayName()); @@ -163,8 +162,8 @@ public class ManageAccountsActivity extends FileActivity case KEY_DELETE_CODE: if (data != null) { Bundle bundle = data.getExtras(); - if (bundle.containsKey(KEY_ACCOUNT)) { - Account account = Parcels.unwrap(bundle.getParcelable(KEY_ACCOUNT)); + if (bundle.containsKey(UserInfoActivity.KEY_ACCOUNT)) { + Account account = Parcels.unwrap(bundle.getParcelable(UserInfoActivity.KEY_ACCOUNT)); mAccountName = account.name; performAccountRemoval(account); } diff --git a/src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java b/src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java index 1dbd1203d9..d0a7766cc3 100644 --- a/src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java @@ -87,10 +87,10 @@ import butterknife.Unbinder; * This Activity presents the user information. */ public class UserInfoActivity extends FileActivity { - private static final String TAG = UserInfoActivity.class.getSimpleName(); + public static final String KEY_ACCOUNT = "ACCOUNT"; + private static final String TAG = UserInfoActivity.class.getSimpleName(); private static final String KEY_USER_DATA = "USER_DATA"; - private static final String KEY_ACCOUNT = "ACCOUNT"; private static final String KEY_DIRECT_REMOVE = "DIRECT_REMOVE"; private static final int KEY_DELETE_CODE = 101;