Commit 42ec861c authored by Mark Sherman's avatar Mark Sherman Committed by Evan W. Patton

Suppress error on HideKeyboard (#1061)

Fixes #1059 
parent 4e0dfe24
...@@ -2212,12 +2212,11 @@ public class Form extends AppCompatActivity ...@@ -2212,12 +2212,11 @@ public class Form extends AppCompatActivity
@SimpleFunction(description = "Hide the onscreen soft keyboard.") @SimpleFunction(description = "Hide the onscreen soft keyboard.")
public void HideKeyboard() { public void HideKeyboard() {
View view = this.getCurrentFocus(); View view = this.getCurrentFocus();
if (view != null) { if (view == null) {
view = frameLayout;
}
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
} else {
dispatchErrorOccurredEvent(this, "HideKeyboard", ErrorMessages.ERROR_NO_FOCUSABLE_VIEW_FOUND);
}
} }
protected boolean isRepl() { protected boolean isRepl() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment