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
@SimpleFunction(description = "Hide the onscreen soft keyboard.")
public void HideKeyboard() {
View view = this.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
} else {
dispatchErrorOccurredEvent(this, "HideKeyboard", ErrorMessages.ERROR_NO_FOCUSABLE_VIEW_FOUND);
if (view == null) {
view = frameLayout;
}
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
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