Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f8e6163 authored by kaiyiz's avatar kaiyiz Committed by Roman Birg
Browse files

Contacts: Show the new added account timely in account list

The new account has been created successfully, but it isn't shown timely.

Show the new added account timely in account list.

CRs-Fixed: 672510

Change-Id: I1bc781878edb14b8958b7c31426caee1d5c463ca
parent ab36b285
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ public class ContactEditorAccountsChangedActivity extends Activity {

    private static final int SUBACTIVITY_ADD_NEW_ACCOUNT = 1;

    private ListView mAccountListView;
    private AccountsListAdapter mAccountListAdapter;
    private ContactEditorUtils mEditorUtils;

@@ -96,11 +97,11 @@ public class ContactEditorAccountsChangedActivity extends Activity {
            button.setText(getString(R.string.add_new_account));
            button.setOnClickListener(mAddAccountClickListener);

            final ListView accountListView = (ListView) findViewById(R.id.account_list);
            mAccountListView = (ListView) findViewById(R.id.account_list);
            mAccountListAdapter = new AccountsListAdapter(this,
                    AccountListFilter.ACCOUNTS_CONTACT_WRITABLE);
            accountListView.setAdapter(mAccountListAdapter);
            accountListView.setOnItemClickListener(mAccountListItemClickListener);
            mAccountListView.setAdapter(mAccountListAdapter);
            mAccountListView.setOnItemClickListener(mAccountListItemClickListener);
        } else {
            // If the user has 0 writable accounts, we will just show the user a message with 2
            // possible action buttons.
@@ -156,6 +157,11 @@ public class ContactEditorAccountsChangedActivity extends Activity {
        // Save this as the default account
        mEditorUtils.saveDefaultAndAllAccounts(account);

        if (mAccountListView != null) {
            mAccountListAdapter = new AccountsListAdapter(this,
                    AccountListFilter.ACCOUNTS_CONTACT_WRITABLE);
            mAccountListView.setAdapter(mAccountListAdapter);
        }
        // Pass account info in activity result intent
        Intent intent = new Intent();
        intent.putExtra(Intents.Insert.ACCOUNT, account);