diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-02-10 17:37:02 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-02-10 17:37:02 +0100 |
commit | 474804b16b3e2a2283df69813304c3e56996b87c (patch) | |
tree | eedbe5cadac6022244ad595a5a7abc3d5ff2860a | |
parent | 30ce34b4e0299fa79ac644b108fed7614c04da06 (diff) |
do not put setup activites on stack twice
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 11 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 36940359d..975981890 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -1294,6 +1294,7 @@ public class ConversationActivity extends XmppActivity startActivity(startConversationActivity); } else { switchToAccount(pendingAccount, true); + return; } finish(); } @@ -1342,16 +1343,20 @@ public class ConversationActivity extends XmppActivity if (xmppConnectionService.getAccounts().size() == 0) { if (mRedirected.compareAndSet(false, true)) { if (Config.X509_VERIFICATION) { - startActivity(new Intent(this, ManageAccountActivity.class)); + Intent redirectionIntent = new Intent(this, ManageAccountActivity.class); + redirectionIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); + startActivity(redirectionIntent); } else if (Config.MAGIC_CREATE_DOMAIN != null) { Log.d(Config.LOGTAG, "First start time: " + FirstStartTime); - startActivity(new Intent(this, WelcomeActivity.class)); + Intent redirectionIntent = new Intent(this, WelcomeActivity.class); + redirectionIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); + startActivity(redirectionIntent); } else { Intent editAccount = new Intent(this, EditAccountActivity.class); editAccount.putExtra("init", true); + editAccount.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(editAccount); } - finish(); } } else if (conversationList.size() <= 0) { if (mRedirected.compareAndSet(false, true)) { diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 6808a4058..48397a75e 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -537,6 +537,9 @@ public abstract class XmppActivity extends Activity { Intent intent = new Intent(this, EditAccountActivity.class); intent.putExtra("jid", account.getJid().toBareJid().toString()); intent.putExtra("init", init); + if (init) { + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); + } startActivity(intent); } |