Merge "Only close the IME if it is Active on the WebView."

This commit is contained in:
Leon Scroggins III
2010-09-02 13:10:30 -07:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 4 deletions

View File

@@ -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();
}

View File

@@ -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);
}
}
/*