summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-10-01 09:18:27 -0700
committerYorke Lee <yorkelee@google.com>2013-10-01 09:18:27 -0700
commit44248ce0d1c4abe9f6b2c484464f131819c0ded5 (patch)
treeb6c7e0bfccdb44dd96a41aba566c41a1b6d33432 /src
parent8ce2a3ca18bf37bc8e40f11cc0f1f0a7e3cd6044 (diff)
downloadpackages_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.java3
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);