mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 12:42:16 -05:00
fixed add account dialog showing up multiple times
This commit is contained in:
parent
fdca690734
commit
d53dc28f4c
@ -49,6 +49,7 @@
|
||||
<activity
|
||||
android:name="eu.siacs.conversations.ui.ManageAccountActivity"
|
||||
android:label="Manage Accounts"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:parentActivityName="eu.siacs.conversations.ui.ConversationActivity" >
|
||||
</activity>
|
||||
<activity
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user