diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index c2afd070a209e..c951ce9a0351d 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -576,7 +576,14 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } mVoiceButton.setVisibility(visibility); } - + + /** Called by SuggestionsAdapter when the cursor contents changed. */ + void onDataSetChanged() { + if (mSearchAutoComplete != null && mSuggestionsAdapter != null) { + mSearchAutoComplete.onFilterComplete(mSuggestionsAdapter.getCount()); + } + } + /** * Hack to determine whether this is the browser, so we can adjust the UI. */ diff --git a/core/java/android/app/SuggestionsAdapter.java b/core/java/android/app/SuggestionsAdapter.java index 3e11a3f55b07f..1ae93150d0490 100644 --- a/core/java/android/app/SuggestionsAdapter.java +++ b/core/java/android/app/SuggestionsAdapter.java @@ -189,6 +189,8 @@ class SuggestionsAdapter extends ResourceCursorAdapter { if (DBG) Log.d(LOG_TAG, "notifyDataSetChanged"); super.notifyDataSetChanged(); + mSearchDialog.onDataSetChanged(); + updateSpinnerState(getCursor()); }