do not put setup activites on stack twice

This commit is contained in:
Daniel Gultsch 2018-02-09 20:09:58 +01:00
parent 4a98d330f0
commit 5335cda50c
2 changed files with 11 additions and 3 deletions

View file

@ -1215,6 +1215,7 @@ public class ConversationActivity extends XmppActivity
startActivity(startConversationActivity); startActivity(startConversationActivity);
} else { } else {
switchToAccount(pendingAccount, true); switchToAccount(pendingAccount, true);
return;
} }
finish(); finish();
} }
@ -1237,15 +1238,19 @@ public class ConversationActivity extends XmppActivity
if (xmppConnectionService.getAccounts().size() == 0) { if (xmppConnectionService.getAccounts().size() == 0) {
if (mRedirected.compareAndSet(false, true)) { if (mRedirected.compareAndSet(false, true)) {
if (Config.X509_VERIFICATION) { 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) { } else if (Config.MAGIC_CREATE_DOMAIN != null) {
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 { } else {
Intent editAccount = new Intent(this, EditAccountActivity.class); Intent editAccount = new Intent(this, EditAccountActivity.class);
editAccount.putExtra("init",true); editAccount.putExtra("init",true);
editAccount.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(editAccount); startActivity(editAccount);
} }
finish();
} }
} else if (conversationList.size() <= 0) { } else if (conversationList.size() <= 0) {
if (mRedirected.compareAndSet(false, true)) { if (mRedirected.compareAndSet(false, true)) {

View file

@ -522,6 +522,9 @@ public abstract class XmppActivity extends Activity {
Intent intent = new Intent(this, EditAccountActivity.class); Intent intent = new Intent(this, EditAccountActivity.class);
intent.putExtra("jid", account.getJid().toBareJid().toString()); intent.putExtra("jid", account.getJid().toBareJid().toString());
intent.putExtra("init", init); 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); startActivity(intent);
} }