diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index 251393c..0b3e044 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -15,6 +15,7 @@
  */
 package com.android.contacts.list;
 
+import com.android.common.widget.CompositeCursorAdapter.Partition;
 import com.android.contacts.R;
 import com.android.contacts.widget.AutoScrollListView;
 
@@ -351,6 +352,9 @@
 
         if (mFilterEnabled && mFilter != null) {
             adapter.setFilter(mFilter);
+            if (mSelectionRequired) {
+                adapter.setSelectedContact(mSelectedContactDirectoryId, mSelectedContactLookupKey);
+            }
         }
     }
 
@@ -372,7 +376,11 @@
             return;
         }
 
-        if (isLoading()) {
+        if (mRefreshingContactUri) {
+            return;
+        }
+
+        if (isLoadingDirectoryList()) {
             return;
         }
 
@@ -381,11 +389,29 @@
             return;
         }
 
+        boolean directoryLoading = true;
+        int count = adapter.getPartitionCount();
+        for (int i = 0; i < count; i++) {
+            Partition partition = adapter.getPartition(i);
+            if (partition instanceof DirectoryPartition) {
+                DirectoryPartition directory = (DirectoryPartition) partition;
+                if (directory.getDirectoryId() == mSelectedContactDirectoryId) {
+                    directoryLoading = directory.isLoading();
+                    break;
+                }
+            }
+        }
+
+        if (directoryLoading) {
+            return;
+        }
+
         adapter.setSelectedContact(mSelectedContactDirectoryId, mSelectedContactLookupKey);
 
         int selectedPosition = adapter.getSelectedContactPosition();
         if (selectedPosition == -1) {
             if (mSelectionRequired) {
+                mSelectionRequired = false;
                 notifyInvalidSelection();
                 return;
             }
diff --git a/src/com/android/contacts/list/ContactEntryListFragment.java b/src/com/android/contacts/list/ContactEntryListFragment.java
index c73b86e..1b7c9dc 100644
--- a/src/com/android/contacts/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/list/ContactEntryListFragment.java
@@ -296,7 +296,7 @@
     @Override
     public void onStart() {
         super.onStart();
-        
+
         mContactsPrefs.registerChangeListener(mPreferencesChangeListener);
 
         if (mProviderStatusLoader == null) {
@@ -450,15 +450,19 @@
             return true;
         }
 
-        if (isSearchMode() && getDirectorySearchMode() != DirectoryListLoader.SEARCH_MODE_NONE
-                && (mDirectoryListStatus == STATUS_NOT_LOADED
-                        || mDirectoryListStatus == STATUS_LOADING)) {
+        if (isLoadingDirectoryList()) {
             return true;
         }
 
         return false;
     }
 
+    public boolean isLoadingDirectoryList() {
+        return isSearchMode() && getDirectorySearchMode() != DirectoryListLoader.SEARCH_MODE_NONE
+                && (mDirectoryListStatus == STATUS_NOT_LOADED
+                        || mDirectoryListStatus == STATUS_LOADING);
+    }
+
     @Override
     public void onStop() {
         super.onStop();
diff --git a/src/com/android/contacts/list/ContactListAdapter.java b/src/com/android/contacts/list/ContactListAdapter.java
index f573003..c647402 100644
--- a/src/com/android/contacts/list/ContactListAdapter.java
+++ b/src/com/android/contacts/list/ContactListAdapter.java
@@ -135,11 +135,8 @@
     }
 
     public void setSelectedContact(long selectedDirectoryId, String lookupKey) {
-        if (mSelectedContactDirectoryId != selectedDirectoryId ||
-                !TextUtils.equals(mSelectedContactLookupKey, lookupKey)) {
-            this.mSelectedContactDirectoryId = selectedDirectoryId;
-            this.mSelectedContactLookupKey = lookupKey;
-        }
+        mSelectedContactDirectoryId = selectedDirectoryId;
+        mSelectedContactLookupKey = lookupKey;
     }
 
     protected static Uri buildSectionIndexerUri(Uri uri) {
