summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-05-30 18:01:00 +0800
committerRoman Birg <roman@cyngn.com>2014-09-02 11:53:43 -0700
commit5f8e6163c1a82be04af89fbbe952e05be9d53e70 (patch)
treecb3d5abf235c6a1eb7a27d6522ab7dfc68ad88b4
parentab36b28595f5b583a831c8fd34adbe63e313cc43 (diff)
downloadpackages_apps_Contacts-5f8e6163c1a82be04af89fbbe952e05be9d53e70.tar.gz
packages_apps_Contacts-5f8e6163c1a82be04af89fbbe952e05be9d53e70.tar.bz2
packages_apps_Contacts-5f8e6163c1a82be04af89fbbe952e05be9d53e70.zip
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
-rw-r--r--src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
index 6ea10c585..3e03891c7 100644
--- a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
@@ -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);