diff options
author | Yorke Lee <yorkelee@google.com> | 2013-10-01 09:18:27 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-10-01 09:18:27 -0700 |
commit | 44248ce0d1c4abe9f6b2c484464f131819c0ded5 (patch) | |
tree | b6c7e0bfccdb44dd96a41aba566c41a1b6d33432 /src | |
parent | 8ce2a3ca18bf37bc8e40f11cc0f1f0a7e3cd6044 (diff) | |
download | packages_apps_ContactsCommon-44248ce0d1c4abe9f6b2c484464f131819c0ded5.tar.gz packages_apps_ContactsCommon-44248ce0d1c4abe9f6b2c484464f131819c0ded5.tar.bz2 packages_apps_ContactsCommon-44248ce0d1c4abe9f6b2c484464f131819c0ded5.zip |
Move list adapter creation from onCreateView to onCreate
Create the fragment's list adapter in onCreate, instead of onCreateView, which
can be called multiple times in the fragment's lifecycle. This fixes a crash in
Dialer where ContactEntryListFragments can be swapped out repeatedly multiple
times, and creating a new adapter each time causes problems.
Bug: 11014225
Change-Id: I37b4adc9606f7b25c444b2230081540320b34c17
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/common/list/ContactEntryListFragment.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/com/android/contacts/common/list/ContactEntryListFragment.java b/src/com/android/contacts/common/list/ContactEntryListFragment.java index f7f555a1..8df8571d 100644 --- a/src/com/android/contacts/common/list/ContactEntryListFragment.java +++ b/src/com/android/contacts/common/list/ContactEntryListFragment.java @@ -243,6 +243,7 @@ public abstract class ContactEntryListFragment<T extends ContactEntryListAdapter @Override public void onCreate(Bundle savedState) { super.onCreate(savedState); + mAdapter = createListAdapter(); mContactsPrefs = new ContactsPreferences(mContext); restoreSavedState(savedState); } @@ -692,8 +693,6 @@ public abstract class ContactEntryListFragment<T extends ContactEntryListAdapter Bundle savedInstanceState) { onCreateView(inflater, container); - mAdapter = createListAdapter(); - boolean searchMode = isSearchMode(); mAdapter.setSearchMode(searchMode); mAdapter.configureDefaultPartition(false, searchMode); |