From 617202a53a26d1b38a41ce69c40b1fffd784c178 Mon Sep 17 00:00:00 2001 From: Mike LeBeau Date: Mon, 6 Jul 2009 14:29:25 -0700 Subject: Fix a bug where clicking the "more results" suggestion with the trackball did not seem to expand to show the corpus selectors. (http://b/1906643) It turns out that when the trackball was used to select this item, onItemClick was getting called on the listener twice in AutoCompleteTextView#onKeyUp: once when we call onKeyUp on the DropDownListView, and once a little further down when we call performCompletion(). In our case, performCompletion() is useless since it was intended for normal AutoCompleteTextViews which populate text into the TextView when an item in the list is clicked, but we do not rely on this. So the easiest fix is just to make performCompletion() do nothing in our SearchAutoComplete subclass. --- core/java/android/app/SearchDialog.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/java/android/app') diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 0785029..fdb619a 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -1573,6 +1573,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } /** + * We override this method to avoid an extra onItemClick being called on the + * drop-down's OnItemClickListener by {@link AutoCompleteTextView#onKeyUp(int, KeyEvent)} + * when an item is clicked with the trackball. + */ + @Override + public void performCompletion() { + } + + /** * We override this method so that we can allow a threshold of zero, which ACTV does not. */ @Override -- cgit v1.1