From 406ed4c6cada7c95965635057160193c9add491c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 11 Aug 2019 16:02:25 -0400 Subject: [PATCH] v0.7.4c: fixed keyboard not hiding correctly when text input is closed --- .../shatteredpixeldungeon/windows/WndTextInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTextInput.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTextInput.java index 56bfd38b5..a4e3fd927 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTextInput.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTextInput.java @@ -36,6 +36,7 @@ import android.widget.TextView; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.backends.android.AndroidApplication; +import com.badlogic.gdx.backends.android.AndroidGraphics; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -204,7 +205,7 @@ public class WndTextInput extends Window { ((ViewGroup) textInput.getParent()).removeView(textInput); InputMethodManager imm = (InputMethodManager)((AndroidApplication)Gdx.app).getSystemService(Activity.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(textInput.getWindowToken(), 0); + imm.hideSoftInputFromWindow(((AndroidGraphics)Gdx.app.getGraphics()).getView().getWindowToken(), 0); //Soft keyboard sometimes triggers software buttons, so make sure to reassert immersive ShatteredPixelDungeon.updateSystemUI();