From ebcb13c8ebdb9f0e1de8ea2c9b4c491f1d8ae308 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 27 Apr 2016 10:35:08 +0200 Subject: made it possible to go back to welcome screen from edit account --- .../java/eu/siacs/conversations/ui/EditAccountActivity.java | 10 +++++++--- src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index d6ea50fb..9dd79ccf 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -315,9 +315,10 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate public void run() { final Intent intent; final XmppConnection connection = mAccount.getXmppConnection(); + final boolean wasFirstAccount = xmppConnectionService != null && xmppConnectionService.getAccounts().size() == 1; if (avatar != null || (connection != null && !connection.getFeatures().pep())) { intent = new Intent(getApplicationContext(), StartConversationActivity.class); - if (xmppConnectionService != null && xmppConnectionService.getAccounts().size() == 1) { + if (wasFirstAccount) { intent.putExtra("init", true); } } else { @@ -325,6 +326,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate intent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().toBareJid().toString()); intent.putExtra("setup", true); } + if (wasFirstAccount) { + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + } startActivity(intent); finish(); } @@ -577,8 +581,8 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate updateAccountInformation(true); } } - if (this.xmppConnectionService.getAccounts().size() == 0 - || this.mAccount == xmppConnectionService.getPendingAccount()) { + if ((Config.MAGIC_CREATE_DOMAIN == null && this.xmppConnectionService.getAccounts().size() == 0) + || (this.mAccount != null && this.mAccount == xmppConnectionService.getPendingAccount())) { if (getActionBar() != null) { getActionBar().setDisplayHomeAsUpEnabled(false); getActionBar().setDisplayShowHomeEnabled(false); diff --git a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java index 5818ffd5..78f0f609 100644 --- a/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java @@ -28,7 +28,6 @@ public class WelcomeActivity extends Activity { @Override public void onClick(View v) { startActivity(new Intent(WelcomeActivity.this, EditAccountActivity.class)); - finish(); } }); -- cgit v1.2.3