Loading core/java/android/app/SearchDialog.java +7 −1 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.ListAdapter; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; Loading Loading @@ -1750,7 +1751,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS // case we want to dismiss the soft keyboard so the user can see the rest of the // shortcuts. if (isInputMethodNotNeeded() || (isEmpty() && getDropDownChildCount() >= getAdapter().getCount())) { (isEmpty() && getDropDownChildCount() >= getAdapterCount())) { mSearchDialog.cancel(); return true; } Loading @@ -1758,6 +1759,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } return false; } private int getAdapterCount() { final ListAdapter adapter = getAdapter(); return adapter == null ? 0 : adapter.getCount(); } } protected boolean handleBackKey(int keyCode, KeyEvent event) { Loading Loading
core/java/android/app/SearchDialog.java +7 −1 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.ListAdapter; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; Loading Loading @@ -1750,7 +1751,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS // case we want to dismiss the soft keyboard so the user can see the rest of the // shortcuts. if (isInputMethodNotNeeded() || (isEmpty() && getDropDownChildCount() >= getAdapter().getCount())) { (isEmpty() && getDropDownChildCount() >= getAdapterCount())) { mSearchDialog.cancel(); return true; } Loading @@ -1758,6 +1759,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } return false; } private int getAdapterCount() { final ListAdapter adapter = getAdapter(); return adapter == null ? 0 : adapter.getCount(); } } protected boolean handleBackKey(int keyCode, KeyEvent event) { Loading