From 8521579e3a6259d1cd10aec769a2c4dee1eda314 Mon Sep 17 00:00:00 2001 From: Lennart Rosam Date: Sat, 14 Apr 2012 11:52:26 +0200 Subject: [PATCH] Fixed a bug, where the AuthenticatorActivity would not set a new default account, when the previous one had been deleted --- .../owncloud/ui/activity/AuthenticatorActivity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/eu/alefzero/owncloud/ui/activity/AuthenticatorActivity.java b/src/eu/alefzero/owncloud/ui/activity/AuthenticatorActivity.java index 9db46e0e4a..f134630dac 100644 --- a/src/eu/alefzero/owncloud/ui/activity/AuthenticatorActivity.java +++ b/src/eu/alefzero/owncloud/ui/activity/AuthenticatorActivity.java @@ -112,10 +112,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity { accManager.addAccountExplicitly(account, password_text.getText().toString(), null); // Add this account as default in the preferences, if there is none already - SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this); - String defaultAccountName = appPreferences.getString("select_oc_account", null); - if(defaultAccountName == null){ - SharedPreferences.Editor editor = appPreferences.edit(); + Account defaultAccount = AuthUtils.getCurrentOwnCloudAccount(this); + if(defaultAccount == null){ + SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); editor.putString("select_oc_account", accountName); editor.commit(); }