summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorMike LeBeau <mlebeau@android.com>2009-07-14 15:57:41 -0700
committerMike LeBeau <mlebeau@android.com>2009-07-14 17:05:24 -0700
commit1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20 (patch)
tree5de756f9dd7222ace4386cd2a8f5383103b73b35 /core/java
parentf77035193152a0edba5abeb33d9c1a5f446c7dd8 (diff)
downloadframeworks_base-1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20.zip
frameworks_base-1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20.tar.gz
frameworks_base-1fffbd97fa756ef7d3e7e885a5c1c8bb64380c20.tar.bz2
Fix keyboard not showing for global search on Dream. Rather than trying to
call the hidden showSoftInputUnchecked method to show the IME in SearchDialog#show(), override onWindowFocusChanged in our subclass of AutoCompleteTextView so that whenever it gets focus, we call the public showSoftInput method, passing in the ACTV, which is the correct way to do this. This fixes http://b/1930989.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/SearchDialog.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 13eb034..1283b8f 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -337,16 +337,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
mActivityContext = mSearchable.getActivityContext(getContext());
// show the dialog. this will call onStart().
- if (!isShowing()) {
- // First make sure the keyboard is showing (if needed), so that we get the right height
- // for the dropdown to respect the IME.
- if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
- Configuration.HARDKEYBOARDHIDDEN_YES) {
- InputMethodManager inputManager = (InputMethodManager)
- getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- inputManager.showSoftInputUnchecked(0, null);
- }
-
+ if (!isShowing()) {
// The Dialog uses a ContextThemeWrapper for the context; use this to change the
// theme out from underneath us, between the global search theme and the in-app
// search theme. They are identical except that the global search theme does not
@@ -1535,7 +1526,22 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
@Override
public void performCompletion() {
}
-
+
+ /**
+ * We override this method to be sure and show the soft keyboard if appropriate when
+ * the TextView has focus.
+ */
+ @Override
+ public void onWindowFocusChanged(boolean hasWindowFocus) {
+ super.onWindowFocusChanged(hasWindowFocus);
+
+ if (hasWindowFocus) {
+ InputMethodManager inputManager = (InputMethodManager)
+ getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ inputManager.showSoftInput(this, 0);
+ }
+ }
+
/**
* We override this method so that we can allow a threshold of zero, which ACTV does not.
*/