diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index 5ae425f..0f95779 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -22,9 +22,12 @@
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ListView;
+import android.widget.TextView;
 
 /**
  * Fragment containing a contact list used for browsing (as compared to
@@ -113,6 +116,13 @@
         }
     }
 
+    @Override
+    protected View createView(LayoutInflater inflater, ViewGroup container) {
+        View view = super.createView(inflater, container);
+        getListView().addHeaderView(inflater.inflate(R.layout.total_contacts, null, false));
+        return view;
+    }
+
     public void setEditMode(boolean flag) {
         mEditMode = flag;
     }
diff --git a/src/com/android/contacts/list/ContactEntryListFragment.java b/src/com/android/contacts/list/ContactEntryListFragment.java
index fefa718..175d352 100644
--- a/src/com/android/contacts/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/list/ContactEntryListFragment.java
@@ -96,6 +96,19 @@
         return mAdapter;
     }
 
+    public void setListAdapter(T adapter) {
+        mAdapter = adapter;
+        mListView.setAdapter(mAdapter);
+        if (isPhotoLoaderEnabled()) {
+            mAdapter.setPhotoLoader(mPhotoLoader);
+        }
+        ((ContactsListActivity)getActivity()).setupListView(mAdapter, mListView);
+    }
+
+    public ListView getListView() {
+        return mListView;
+    }
+
     // TODO make abstract
     @Override
     protected Loader<Cursor> onCreateLoader(int id, Bundle args) {
@@ -114,6 +127,26 @@
             String text = getQuantityText(data.getCount(),
                     R.string.listFoundAllContactsZero, R.plurals.listFoundAllContacts);
             foundContactsText.setText(text);
+
+            TextView totalContacts = (TextView) mView.findViewById(R.id.totalContactsText);
+
+            int count = data.getCount();
+
+            if (isSearchMode()
+                    && !TextUtils.isEmpty(getQueryString())) {
+                text = getQuantityText(count, R.string.listFoundAllContactsZero,
+                        R.plurals.searchFoundContacts);
+            } else {
+                // TODO
+//            if (contactsListActivity.mDisplayOnlyPhones) {
+//                text = contactsListActivity.getQuantityText(count,
+//                        R.string.listTotalPhoneContactsZero, R.plurals.listTotalPhoneContacts);
+//            } else {
+                text = getQuantityText(count,
+                        R.string.listTotalAllContactsZero, R.plurals.listTotalAllContacts);
+//            }
+            }
+            totalContacts.setText(text);
         }
     }
 
@@ -222,26 +255,27 @@
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container) {
-        mView = inflateView(inflater, container);
+        mView = createView(inflater, container);
         mAdapter = createListAdapter();
-        configureView(mView);
+        setListAdapter(mAdapter);
         return mView;
     }
 
-    protected void configureView(View view) {
-        mListView = (ListView)view.findViewById(android.R.id.list);
+    protected View createView(LayoutInflater inflater, ViewGroup container) {
+        mView = inflateView(inflater, container);
+
+        mListView = (ListView)mView.findViewById(android.R.id.list);
         if (mListView == null) {
             throw new RuntimeException(
                     "Your content must have a ListView whose id attribute is " +
                     "'android.R.id.list'");
         }
 
-        View emptyView = view.findViewById(com.android.internal.R.id.empty);
+        View emptyView = mView.findViewById(com.android.internal.R.id.empty);
         if (emptyView != null) {
             mListView.setEmptyView(emptyView);
         }
 
-        mListView.setAdapter(mAdapter);
         mListView.setOnItemClickListener(this);
         mListView.setOnFocusChangeListener(this);
         mListView.setOnTouchListener(this);
@@ -257,17 +291,14 @@
             mListView.setOnCreateContextMenuListener(mContextMenuAdapter);
         }
 
-        configurePinnedHeader();
-
         if (isPhotoLoaderEnabled()) {
             mPhotoLoader =
                 new ContactPhotoLoader(getActivity(), R.drawable.ic_contact_list_picture);
-            mAdapter.setPhotoLoader(mPhotoLoader);
             mListView.setOnScrollListener(this);
         }
 
         if (isSearchMode()) {
-            mSearchEditText = (SearchEditText)view.findViewById(R.id.search_src_text);
+            mSearchEditText = (SearchEditText)mView.findViewById(R.id.search_src_text);
             mSearchEditText.setText(getQueryString());
             mSearchEditText.addTextChangedListener(this);
             mSearchEditText.setOnEditorActionListener(this);
@@ -275,14 +306,13 @@
         }
 
         if (isSearchResultsMode()) {
-            TextView titleText = (TextView)view.findViewById(R.id.search_results_for);
+            TextView titleText = (TextView)mView.findViewById(R.id.search_results_for);
             if (titleText != null) {
                 titleText.setText(Html.fromHtml(getActivity().getString(R.string.search_results_for,
                         "<b>" + getQueryString() + "</b>")));
             }
         }
-
-        ((ContactsListActivity)getActivity()).setupListView(mAdapter, mListView);
+        return mView;
     }
 
     public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
@@ -314,17 +344,6 @@
         super.onDestroy();
     }
 
-    private void configurePinnedHeader() {
-        if (!mSectionHeaderDisplayEnabled) {
-            return;
-        }
-
-        if (mListView instanceof PinnedHeaderListView) {
-            PinnedHeaderListView pinnedHeaderList = (PinnedHeaderListView)mListView;
-            View headerView = mAdapter.createPinnedHeaderView(pinnedHeaderList);
-            pinnedHeaderList.setPinnedHeaderView(headerView);
-        }
-    }
 
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         hideSoftKeyboard();
diff --git a/src/com/android/contacts/list/PinnedHeaderListAdapter.java b/src/com/android/contacts/list/PinnedHeaderListAdapter.java
index 27deef3..dd1542e 100644
--- a/src/com/android/contacts/list/PinnedHeaderListAdapter.java
+++ b/src/com/android/contacts/list/PinnedHeaderListAdapter.java
@@ -22,6 +22,7 @@
 import android.content.res.ColorStateList;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
+import android.opengl.Visibility;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -96,7 +97,7 @@
      * visible or partially pushed up out of the view.
      */
     public int getPinnedHeaderState(int position) {
-        if (mIndexer == null || mCursor == null || mCursor.getCount() == 0) {
+        if (mIndexer == null || position < 0 || mCursor == null || mCursor.getCount() == 0) {
             return PINNED_HEADER_GONE;
         }
 
diff --git a/src/com/android/contacts/widget/PinnedHeaderListView.java b/src/com/android/contacts/widget/PinnedHeaderListView.java
index 24e5638..bdc66d5 100644
--- a/src/com/android/contacts/widget/PinnedHeaderListView.java
+++ b/src/com/android/contacts/widget/PinnedHeaderListView.java
@@ -20,6 +20,7 @@
 import android.graphics.Canvas;
 import android.util.AttributeSet;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.AbsListView;
 import android.widget.ListAdapter;
 import android.widget.ListView;
@@ -53,6 +54,11 @@
         public static final int PINNED_HEADER_PUSHED_UP = 2;
 
         /**
+         * Creates the pinned header view.
+         */
+        View createPinnedHeaderView(ViewGroup parent);
+
+        /**
          * Computes the desired state of the pinned header for the given
          * position of the first visible list item. Allowed return values are
          * {@link #PINNED_HEADER_GONE}, {@link #PINNED_HEADER_VISIBLE} or
@@ -75,9 +81,7 @@
     private PinnedHeaderAdapter mAdapter;
     private View mHeaderView;
     private boolean mHeaderViewVisible;
-
     private int mHeaderViewWidth;
-
     private int mHeaderViewHeight;
 
     private OnScrollListener mOnScrollListener;
@@ -112,6 +116,8 @@
     public void setAdapter(ListAdapter adapter) {
         super.setAdapter(adapter);
         mAdapter = (PinnedHeaderAdapter)adapter;
+        View headerView = mAdapter.createPinnedHeaderView(this);
+        setPinnedHeaderView(headerView);
     }
 
     @Override
@@ -124,7 +130,7 @@
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         if (mHeaderView != null) {
-            configureHeaderView(getFirstVisiblePosition());
+            configureHeaderView(getFirstVisiblePosition() - getHeaderViewsCount());
             measureChild(mHeaderView, widthMeasureSpec, heightMeasureSpec);
             mHeaderViewWidth = mHeaderView.getMeasuredWidth();
             mHeaderViewHeight = mHeaderView.getMeasuredHeight();
@@ -135,13 +141,13 @@
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         super.onLayout(changed, left, top, right, bottom);
         if (mHeaderView != null) {
-            mHeaderView.layout(0, 0, mHeaderViewWidth, mHeaderViewHeight);
+            mHeaderView.layout(0, mHeaderView.getTop(), mHeaderViewWidth, mHeaderViewHeight);
         }
     }
 
     public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
             int totalItemCount) {
-        configureHeaderView(firstVisibleItem);
+        configureHeaderView(firstVisibleItem - getHeaderViewsCount());
         if (mOnScrollListener != null) {
             mOnScrollListener.onScroll(this, firstVisibleItem, visibleItemCount, totalItemCount);
         }
@@ -177,8 +183,7 @@
             case PinnedHeaderAdapter.PINNED_HEADER_PUSHED_UP: {
                 View firstView = getChildAt(0);
                 int bottom = firstView.getBottom();
-                int itemHeight = firstView.getHeight();
-                int headerHeight = mHeaderView.getHeight();
+                int headerHeight = mHeaderViewHeight;
                 int y;
                 int alpha;
                 if (bottom < headerHeight) {
@@ -190,7 +195,7 @@
                 }
                 mAdapter.configurePinnedHeader(mHeaderView, position, alpha);
                 if (mHeaderView.getTop() != y) {
-                    mHeaderView.layout(0, y, mHeaderViewWidth, mHeaderViewHeight + y);
+                    mHeaderView.layout(0, y, headerHeight, headerHeight + y);
                 }
                 mHeaderViewVisible = true;
                 break;
