Merge pull request #26353 from ivanarh/android_hide_keyboard_crash

Android: Fixed a possible crash in keyboard hide method.
This commit is contained in:
Rémi Verschelde 2019-03-01 20:19:48 +01:00 committed by GitHub
commit 351a2fa41c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -516,14 +516,6 @@ public class GodotIO {
public void hideKeyboard() {
if (edit != null)
edit.hideKeyboard();
InputMethodManager inputMgr = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
View v = activity.getCurrentFocus();
if (v != null) {
inputMgr.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
} else {
inputMgr.hideSoftInputFromWindow(new View(activity).getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
};
public void setScreenOrientation(int p_orientation) {