mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
Fixed a bug, where the AuthenticatorActivity would not set a new default
account, when the previous one had been deleted
This commit is contained in:
parent
e85c47aaea
commit
8521579e3a
1 changed files with 3 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue