diff --git a/src/android/app/patterns/LoaderManagingFragment.java b/src/android/app/patterns/LoaderManagingFragment.java
index e0a464b..20b5a88 100644
--- a/src/android/app/patterns/LoaderManagingFragment.java
+++ b/src/android/app/patterns/LoaderManagingFragment.java
@@ -38,7 +38,7 @@
      * when the new loader completes it's work. The callback will be delivered before the old loader
      * is destroyed.
      */
-    protected void startLoading(int id, Bundle args) {
+    protected Loader<D> startLoading(int id, Bundle args) {
         LoaderInfo<D> info = mLoaders.get(id);
         if (info != null) {
             // Keep track of the previous instance of this loader so we can destroy
@@ -56,6 +56,7 @@
             loader.registerListener(id, this);
             loader.startLoading();
         }
+        return loader;
     }
 
     protected abstract Loader<D> onCreateLoader(int id, Bundle args);
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index e0b5f98..160bacc 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -658,7 +658,7 @@
                     fragment.setSectionHeaderDisplayEnabled(true);
                 }
 
-                if (mMode == MODE_INSERT_OR_EDIT_CONTACT) {
+                if (mMode == MODE_PICK_OR_CREATE_CONTACT) {
                     fragment.setCreateContactEnabled(true);
                 }
 
@@ -1972,6 +1972,12 @@
     }
 
     public void startQuery() {
+
+        // Disabled
+        if (true) {
+            return;
+        }
+
         if (mSearchResultsMode) {
             TextView foundContactsText = (TextView)findViewById(R.id.search_results_found);
             foundContactsText.setText(R.string.search_results_searching);
diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index 0614772..accf42a 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -15,11 +15,7 @@
  */
 package com.android.contacts.list;
 
-import android.app.patterns.CursorLoader;
-import android.app.patterns.Loader;
-import android.database.Cursor;
 import android.net.Uri;
-import android.os.Bundle;
 
 /**
  * Fragment containing a contact list used for browsing (as compared to
@@ -30,39 +26,10 @@
 
     private OnContactBrowserActionListener mListener;
 
-    private CursorLoader mLoader;
-
-    @Override
-    protected CursorLoader onCreateLoader(int id, Bundle args) {
-        mLoader = new CursorLoader(getActivity(), null, null, null, null, null);
-        return mLoader;
-    }
-
-    public CursorLoader getLoader() {
-        return mLoader;
-    }
-
-    @Override
-    protected void reloadData() {
-        getAdapter().configureLoader(mLoader);
-        mLoader.forceLoad();
-    }
-
     public void setOnContactListActionListener(OnContactBrowserActionListener listener) {
         mListener = listener;
     }
 
-    @Override
-    protected void onInitializeLoaders() {
-        startLoading(0, null);
-    }
-
-    @Override
-    protected void onLoadFinished(Loader<Cursor> loader, Cursor data) {
-        super.onLoadFinished(loader, data);
-        getAdapter().changeCursor(data);
-    }
-
     public void createNewContact() {
         mListener.onCreateNewContactAction();
     }
diff --git a/src/com/android/contacts/list/ContactEntryListFragment.java b/src/com/android/contacts/list/ContactEntryListFragment.java
index 9a3bf1d..3ccd973 100644
--- a/src/com/android/contacts/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/list/ContactEntryListFragment.java
@@ -21,10 +21,10 @@
 import com.android.contacts.ContactsListActivity;
 import com.android.contacts.R;
 import com.android.contacts.widget.ContextMenuAdapter;
-import com.android.contacts.widget.PinnedHeaderListView;
 import com.android.contacts.widget.SearchEditText;
 import com.android.contacts.widget.SearchEditText.OnCloseListener;
 
+import android.app.patterns.CursorLoader;
 import android.app.patterns.Loader;
 import android.app.patterns.LoaderManagingFragment;
 import android.content.Context;
@@ -70,6 +70,7 @@
     private String mQueryString;
 
     private ContactsApplicationController mAppController;
+    private CursorLoader mLoader;
     private T mAdapter;
     private View mView;
     private ListView mListView;
@@ -87,7 +88,6 @@
     private ContactPhotoLoader mPhotoLoader;
     private SearchEditText mSearchEditText;
 
-
     protected abstract View inflateView(LayoutInflater inflater, ViewGroup container);
     protected abstract T createListAdapter();
 
@@ -98,6 +98,10 @@
      */
     protected abstract void onItemClick(int position, long id);
 
+    public CursorLoader getLoader() {
+        return mLoader;
+    }
+
     public T getAdapter() {
         return mAdapter;
     }
@@ -119,15 +123,14 @@
         return mListView;
     }
 
-    // TODO make abstract
     @Override
     protected Loader<Cursor> onCreateLoader(int id, Bundle args) {
-        throw new UnsupportedOperationException();
+        return new CursorLoader(getActivity(), null, null, null, null, null);
     }
 
-    // TODO make abstract
     @Override
     protected void onInitializeLoaders() {
+        mLoader = (CursorLoader)startLoading(0, null);
     }
 
     @Override
@@ -136,20 +139,25 @@
             return;
         }
 
+        mAdapter.changeCursor(data);
         showCount(data);
     }
 
+    protected void reloadData() {
+        mAdapter.configureLoader(mLoader);
+        mLoader.forceLoad();
+    }
+
     /**
-     * Shows the count of entries included in the list.
+     * Shows the count of entries included in the list. The default
+     * implementation does nothing.
      */
     protected void showCount(Cursor data) {
     }
 
-    protected void reloadData() {
-    }
-
     /**
-     * Override to provide logic that dismisses this fragment.
+     * Provides logic that dismisses this fragment. The default implementation
+     * does nothing.
      */
     protected void finish() {
     }
@@ -252,6 +260,7 @@
     public View onCreateView(LayoutInflater inflater, ViewGroup container) {
         mView = createView(inflater, container);
         mAdapter = createListAdapter();
+        mAdapter.configureLoader(mLoader);
         setListAdapter(mAdapter);
         return mView;
     }
diff --git a/src/com/android/contacts/list/ContactListAdapter.java b/src/com/android/contacts/list/ContactListAdapter.java
index 1b6e444..e13ba58 100644
--- a/src/com/android/contacts/list/ContactListAdapter.java
+++ b/src/com/android/contacts/list/ContactListAdapter.java
@@ -111,6 +111,10 @@
         return getCursor().getString(mDisplayNameColumnIndex);
     }
 
+    public boolean isQuickContactEnabled() {
+        return mQuickContactEnabled;
+    }
+
     public void setQuickContactEnabled(boolean quickContactEnabled) {
         mQuickContactEnabled = quickContactEnabled;
     }
diff --git a/src/com/android/contacts/list/ContactPickerFragment.java b/src/com/android/contacts/list/ContactPickerFragment.java
index 930646b..62ac1c3 100644
--- a/src/com/android/contacts/list/ContactPickerFragment.java
+++ b/src/com/android/contacts/list/ContactPickerFragment.java
@@ -17,10 +17,10 @@
 
 import com.android.contacts.R;
 
-import android.content.Intent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.AdapterView;
 
 /**
  * Fragment for the contact list used for browsing contacts (as compared to
@@ -35,23 +35,44 @@
         mListener = listener;
     }
 
+    public void setCreateContactEnabled(boolean flag) {
+        this.mCreateContactEnabled = flag;
+    }
+
+    public boolean isCreateContactEnabled() {
+        return mCreateContactEnabled;
+    }
+
+    @Override
+    protected View createView(LayoutInflater inflater, ViewGroup container) {
+        View view = super.createView(inflater, container);
+        if (mCreateContactEnabled) {
+            getListView().addHeaderView(inflater.inflate(R.layout.create_new_contact, null, false));
+        }
+        return view;
+    }
+
     public boolean isSearchAllContactsItemPosition(int position) {
         return isSearchMode() && position == getAdapter().getCount() - 1;
     }
 
     @Override
+    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+        if (position == 0 && !isSearchMode() && mCreateContactEnabled) {
+            mListener.onCreateNewContactAction();
+        } else {
+            super.onItemClick(parent, view, position, id);
+        }
+    }
+
+    @Override
     protected void onItemClick(int position, long id) {
         if (isSearchAllContactsItemPosition(position)) {
             mListener.onSearchAllContactsAction((String)null);
         } else {
-            Intent intent;
-            if (position == 0 && !isSearchMode() && isCreateContactEnabled()) {
-                mListener.onCreateNewContactAction();
-            } else {
-                ContactListAdapter adapter = getAdapter();
-                adapter.moveToPosition(position);
-                mListener.onPickContactAction(adapter.getContactUri());
-            }
+            ContactListAdapter adapter = getAdapter();
+            adapter.moveToPosition(position);
+            mListener.onPickContactAction(adapter.getContactUri());
         }
     }
 
@@ -59,8 +80,17 @@
     protected ContactListAdapter createListAdapter() {
         // TODO different adapter
         ContactListAdapter adapter = new DefaultContactListAdapter(getActivity());
-        adapter.setSectionHeaderDisplayEnabled(isSectionHeaderDisplayEnabled());
-        adapter.setDisplayPhotos(isPhotoLoaderEnabled());
+        adapter.setSectionHeaderDisplayEnabled(true);
+
+        adapter.setDisplayPhotos(true);
+        adapter.setQuickContactEnabled(false);
+
+        adapter.setSearchMode(isSearchMode());
+        adapter.setSearchResultsMode(isSearchResultsMode());
+        adapter.setQueryString(getQueryString());
+
+        adapter.setContactNameDisplayOrder(getContactNameDisplayOrder());
+        adapter.setSortOrder(getSortOrder());
 
         // TODO more settings
 
@@ -77,12 +107,4 @@
             return inflater.inflate(R.layout.contacts_list_content, null);
         }
     }
-
-    public void setCreateContactEnabled(boolean flag) {
-        this.mCreateContactEnabled = flag;
-    }
-
-    public boolean isCreateContactEnabled() {
-        return mCreateContactEnabled;
-    }
 }
diff --git a/src/com/android/contacts/list/DefaultContactListAdapter.java b/src/com/android/contacts/list/DefaultContactListAdapter.java
index 309475c..3ddf42c 100644
--- a/src/com/android/contacts/list/DefaultContactListAdapter.java
+++ b/src/com/android/contacts/list/DefaultContactListAdapter.java
@@ -77,7 +77,13 @@
         final ContactListItemView view = (ContactListItemView)itemView;
 
         bindSectionHeaderAndDivider(view, cursor);
-        bindQuickContact(view, cursor);
+
+        if (isQuickContactEnabled()) {
+            bindQuickContact(view, cursor);
+        } else {
+            bindPhoto(view, cursor);
+        }
+
         bindName(view, cursor);
         bindPresence(view, cursor);
 
