diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 8502dae87..625a7769d 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1207,17 +1207,22 @@ public class ConversationActivity extends XmppActivity mPostponedActivityResult = null; } - private void redirectToStartConversationActivity() { + private void redirectToStartConversationActivity(boolean noAnimation) { Account pendingAccount = xmppConnectionService.getPendingAccount(); if (pendingAccount == null) { Intent startConversationActivity = new Intent(this, StartConversationActivity.class); + startConversationActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + if (noAnimation) { + startConversationActivity.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); + } startConversationActivity.putExtra("init", true); startActivity(startConversationActivity); + if (noAnimation) { + overridePendingTransition(0,0); + } } else { switchToAccount(pendingAccount, true); - return; } - finish(); } @Override @@ -1241,20 +1246,23 @@ public class ConversationActivity extends XmppActivity 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); + overridePendingTransition(0,0); } else if (Config.MAGIC_CREATE_DOMAIN != null) { 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); + overridePendingTransition(0,0); } 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); + overridePendingTransition(0,0); } } } else if (conversationList.size() <= 0) { if (mRedirected.compareAndSet(false, true)) { - redirectToStartConversationActivity(); + redirectToStartConversationActivity(true); } } else if (selectConversationByUuid(mOpenConversation)) { if (mPanelOpen) { @@ -1819,7 +1827,7 @@ public class ConversationActivity extends XmppActivity } } else { if (!isStopping() && mRedirected.compareAndSet(false, true)) { - redirectToStartConversationActivity(); + redirectToStartConversationActivity(false); } Log.d(Config.LOGTAG,"not updating conversations fragment because conversations list size was 0"); } diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 18899bb11..3428fe057 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -526,6 +526,7 @@ public abstract class XmppActivity extends Activity { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); } startActivity(intent); + overridePendingTransition(0,0); } protected void delegateUriPermissionsToService(Uri uri) {