summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <>2009-03-24 20:49:27 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 20:49:27 -0700
commitf85f081ded685dd9a0391f4e71a52fb8f9e72358 (patch)
tree92919d12f974281d5d49ba7e0c657efb5699180f /core
parenteffd8d55b2394e3f9a772fd6b71684546e17004f (diff)
downloadframeworks_base-f85f081ded685dd9a0391f4e71a52fb8f9e72358.zip
frameworks_base-f85f081ded685dd9a0391f4e71a52fb8f9e72358.tar.gz
frameworks_base-f85f081ded685dd9a0391f4e71a52fb8f9e72358.tar.bz2
Automated import from //branches/master/...@141727,141727
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/SearchDialog.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 64288d2..a0cdb63 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -49,6 +49,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
@@ -922,6 +923,20 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
}
};
+ @Override
+ public void cancel() {
+ // We made sure the IME was displayed, so also make sure it is closed
+ // when we go away.
+ InputMethodManager imm = (InputMethodManager)getContext()
+ .getSystemService(Context.INPUT_METHOD_SERVICE);
+ if (imm != null) {
+ imm.hideSoftInputFromWindow(
+ getWindow().getDecorView().getWindowToken(), 0);
+ }
+
+ super.cancel();
+ }
+
/**
* Various ways to launch searches
*/