summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/webkit/WebTextView.java6
-rw-r--r--core/java/android/webkit/WebView.java6
2 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 990f891..4d85046 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -594,8 +594,10 @@ import java.util.ArrayList;
*/
/* package */ void remove() {
// hide the soft keyboard when the edit text is out of focus
- InputMethodManager.getInstance(mContext).hideSoftInputFromWindow(
- getWindowToken(), 0);
+ InputMethodManager imm = InputMethodManager.getInstance(mContext);
+ if (imm.isActive(this)) {
+ imm.hideSoftInputFromWindow(getWindowToken(), 0);
+ }
mWebView.removeView(this);
mWebView.requestFocus();
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 0b236af..b83edc7 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -3701,8 +3701,10 @@ public class WebView extends AbsoluteLayout
private void hideSoftKeyboard() {
InputMethodManager imm = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
-
- imm.hideSoftInputFromWindow(this.getWindowToken(), 0);
+ if (imm.isActive(this)
+ || (inEditingMode() && imm.isActive(mWebTextView))) {
+ imm.hideSoftInputFromWindow(this.getWindowToken(), 0);
+ }
}
/*