aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-04-27 10:35:08 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-04-27 10:35:08 +0200
commitebcb13c8ebdb9f0e1de8ea2c9b4c491f1d8ae308 (patch)
treee68a7202de5a2e5895f83a2c3697698f90f9d83a /src/main/java/eu/siacs
parente6b526230a9236dca75e1dbed1f0e1b1aaea75fb (diff)
made it possible to go back to welcome screen from edit account
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java10
-rw-r--r--src/main/java/eu/siacs/conversations/ui/WelcomeActivity.java1
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();
}
});