You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Android: Fixed a possible crash in keyboard hide method. It's called not from main thread so InputMethodManager can't be used directly.
This commit is contained in:
@@ -516,14 +516,6 @@ public class GodotIO {
|
|||||||
public void hideKeyboard() {
|
public void hideKeyboard() {
|
||||||
if (edit != null)
|
if (edit != null)
|
||||||
edit.hideKeyboard();
|
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) {
|
public void setScreenOrientation(int p_orientation) {
|
||||||
|
|||||||
Reference in New Issue
Block a user