From 9103802288e4a4c1065b19b11e9905f20ac76735 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 2 Apr 2019 21:59:41 +0200 Subject: fix account detection in EnterNameActivity --- src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 1 + src/main/java/de/pixart/messenger/ui/EnterNameActivity.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index f1f2912ae..bba551a6c 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -310,6 +310,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat private void next() { if (redirectInProgress.compareAndSet(false, true)) { Intent intent = new Intent(this, EnterNameActivity.class); + intent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().asBareJid().toString()); startActivity(intent); overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); diff --git a/src/main/java/de/pixart/messenger/ui/EnterNameActivity.java b/src/main/java/de/pixart/messenger/ui/EnterNameActivity.java index ccfd88dad..eefda7df9 100644 --- a/src/main/java/de/pixart/messenger/ui/EnterNameActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EnterNameActivity.java @@ -12,7 +12,6 @@ import de.pixart.messenger.R; import de.pixart.messenger.databinding.ActivityEnterNameBinding; import de.pixart.messenger.entities.Account; import de.pixart.messenger.services.XmppConnectionService; -import de.pixart.messenger.utils.AccountUtils; import de.pixart.messenger.utils.FirstStartManager; public class EnterNameActivity extends XmppActivity implements XmppConnectionService.OnAccountUpdate { @@ -77,8 +76,10 @@ public class EnterNameActivity extends XmppActivity implements XmppConnectionSer @Override void onBackendConnected() { - this.account = AccountUtils.getFirst(xmppConnectionService); - checkSuggestPreviousNick(); + this.account = extractAccount(getIntent()); + if (this.account != null) { + checkSuggestPreviousNick(); + } updateNextButton(); } -- cgit v1.2.3