+ * Tries to swap the current ownCloud {@link Account} for other valid and existing.
+ *
+ * If no valid ownCloud {@link Account} exists, the the user is requested
+ * to create a new ownCloud {@link Account}.
+ *
+ * POSTCONDITION: updates {@link #mAccountWasSet} and {@link #mAccountWasRestored}.
+ *
+ * @return 'True' if the checked {@link Account} was valid.
+ */
+ private void swapToDefaultAccount() {
+ // default to the most recently used account
+ Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
+ if (newAccount == null) {
+ /// no account available: force account creation
+ createFirstAccount();
+ mRedirectingToSetupAccount = true;
+ mAccountWasSet = false;
+ mAccountWasRestored = false;
+
+ } else {
+ mAccountWasSet = true;
+ mAccountWasRestored = (newAccount.equals(mAccount));
+ mAccount = newAccount;
+ }
+ }
+
+
+ /**