From d53dc28f4cb79d3508db2a30c5fab758f8a8ff13 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 1 Apr 2014 23:16:19 +0200 Subject: [PATCH] fixed add account dialog showing up multiple times --- AndroidManifest.xml | 1 + src/eu/siacs/conversations/ui/ManageAccountActivity.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4dce0d43f..de398467d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -49,6 +49,7 @@ accountList = new ArrayList(); protected ListView accountListView; protected ArrayAdapter accountListViewAdapter; @@ -201,7 +202,7 @@ public class ManageAccountActivity extends XmppActivity { activity.xmppConnectionService.reconnectAccount(accountList.get(position),true); } else if (account.getStatus() == Account.STATUS_ONLINE) { activity.startActivity(new Intent(activity.getApplicationContext(),ContactsActivity.class)); - } else if (account.isOptionSet(Account.OPTION_REGISTER)) { + } else if (account.getStatus() != Account.STATUS_DISABLED) { editAccount(account); } } else { @@ -382,9 +383,10 @@ public class ManageAccountActivity extends XmppActivity { this.accountList.clear(); this.accountList.addAll(xmppConnectionService.getAccounts()); accountListViewAdapter.notifyDataSetChanged(); - if (this.accountList.size() == 0) { + if ((this.accountList.size() == 0)&&(this.firstrun)) { getActionBar().setDisplayHomeAsUpEnabled(false); addAccount(); + this.firstrun = false; } }