aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-01 23:16:19 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-01 23:16:19 +0200
commitd53dc28f4cb79d3508db2a30c5fab758f8a8ff13 (patch)
treea6a25641fe76875dd89a8b1e3b686e82b0462f70 /src/eu/siacs
parentfdca6907348702ed917ea633c96b909e899c2b3a (diff)
fixed add account dialog showing up multiple times
Diffstat (limited to 'src/eu/siacs')
-rw-r--r--src/eu/siacs/conversations/ui/ManageAccountActivity.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
index 624f1a7e..122c8eee 100644
--- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
@@ -12,7 +12,6 @@ import eu.siacs.conversations.xmpp.OnTLSExceptionReceived;
import eu.siacs.conversations.xmpp.XmppConnection;
import android.app.Activity;
import android.app.AlertDialog;
-import android.content.ClipData.Item;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -44,6 +43,8 @@ public class ManageAccountActivity extends XmppActivity {
protected Account selectedAccountForActionMode = null;
protected ManageAccountActivity activity = this;
+ protected boolean firstrun = true;
+
protected List<Account> accountList = new ArrayList<Account>();
protected ListView accountListView;
protected ArrayAdapter<Account> 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;
}
}